Skip to content

Packages  ›  trotsky  ›  StepActorKnownFollowers

StepActorKnownFollowers class

Represents a step for retrieving an actor's known followers (mutual connections) using the Bluesky API. Supports paginated retrieval of known followers.

Signature:

typescript
export declare class StepActorKnownFollowers<P = StepActor, C extends StepActorOutput = StepActorOutput, O extends StepActorKnownFollowersOutput = StepActorKnownFollowersOutput> extends StepActors<P, C, O>

Extends: StepActors<P, C, O>

Example 1

Get and iterate through an actor's known followers:

ts
await Trotsky.init(agent)
  .actor("bsky.app")
  .knownFollowers()
  .each()
  .tap((step) => {
    console.log(`Known follower: ${step.context.handle}`)
  })
  .run()

Example 2

Find mutual connections and follow them:

ts
await Trotsky.init(agent)
  .actor("friend.bsky.social")
  .knownFollowers()
  .each()
  .when((step) => !step?.context?.viewer?.following)
  .follow()
  .wait(2000)
  .run()

Methods

Method

Modifiers

Description

applyPagination()

Applies pagination to retrieve known followers and sets the output. Fetches paginated results using the agent and appends them to the output.