Skip to content

Packages  ›  trotsky  ›  StepActorStarterPacks

StepActorStarterPacks class

Represents a step for retrieving an actor's starter packs using the Bluesky API. Supports paginated retrieval of starter packs.

Signature:

typescript
export declare class StepActorStarterPacks<P = StepActor, C extends StepActorOutput = StepActorOutput, O extends StepActorStarterPacksOutput = StepActorStarterPacksOutput> extends StepStarterPacks<P, C, O>

Extends: StepStarterPacks<P, C, O>

Example 1

Get an actor's starter packs:

ts
await Trotsky.init(agent)
  .actor("alice.bsky.social")
  .starterPacks()
  .each()
  .tap((step) => {
    console.log(`Pack: ${step.context.uri}`)
    console.log(`Creator: @${step.context.creator.handle}`)
    console.log(`Members: ${step.context.listItemCount || 0}`)
  })
  .run()

Example 2

Follow members from an actor's popular starter packs:

ts
await Trotsky.init(agent)
  .actor("bob.bsky.social")
  .starterPacks()
  .each()
  .when((step) => (step?.context?.joinedAllTimeCount || 0) > 50)
  .tap((step) => {
    console.log(`Popular pack: ${step.context.uri}`)
  })
  .run()

Methods

Method

Modifiers

Description

applyPagination()

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

queryParams(cursor)

Generates query parameters for retrieving starter packs, including the optional cursor.