Packages › trotsky › StepActor
StepActor class
Represents a step for retrieving and handling an actor's profile using the Bluesky API.
Signature:
typescript
export declare class StepActor<P = StepBuilder, C = null, O extends StepActorOutput = StepActorOutput> extends ActorMixins<P, C, O>Extends: ActorMixins<P, C, O>
Example 1
Get an actor's profile:
ts
await Trotsky.init(agent)
.actor("bsky.app")
.tap((step) => {
console.log(step.context.displayName)
console.log(step.context.followersCount)
})
.run()Example 2
Follow an actor:
ts
await Trotsky.init(agent)
.actor("alice.bsky.social")
.follow()
.run()Constructors
Constructor | Modifiers | Description |
|---|---|---|
Initializes a new StepActor instance. |
Methods
Method | Modifiers | Description |
|---|---|---|
Applies the step by resolving the actor parameter and fetching the actor's profile. Sets the profile data as the output of this step. | ||
Clones the current step and returns a new instance with the same parameters. |