Overview
TheBluesky facade is a thin wrapper over BlueskyManager. BlueskyManager manages the active Agent (either LegacyAgent or OAuthAgent) and delegates commonly used API calls through the HasShortHand trait.
Architecture
BlueskyServiceProvider registers Factory::class bound to BlueskyManager as a scoped singleton (one instance per request lifecycle).
getFacadeAccessor() resolves this binding.
BlueskyManager core methods
The following methods are defined directly onBlueskyManager, separate from the HasShortHand trait methods.
Authentication
Agent management
HTTP clients
Utilities
The HasShortHand trait
TheHasShortHand trait wraps low-level AT Protocol APIs into readable PHP methods. Adding use HasShortHand; to BlueskyManager makes all of these methods directly accessible via Bluesky::.
Separating the shortcuts into a trait keeps
BlueskyManager focused on session and agent management while still exposing a rich API surface. It also makes individual methods easier to test or override.Posts and feeds
Engagement
Follows
Profile and account
Media
Notifications
AT Protocol record operations
Feed generators and labelers
Common shortcut examples
Create a post
Reply to a post
There is no dedicatedreply() method in HasShortHand. You build the reply with Post::build() and pass a StrongRef for the parent, then call the regular post() shortcut.
Like and repost
Update your profile
upsertProfile() fetches the current profile and persists any changes made inside the closure. Use the Profile object’s methods to set the display name, description, and more.
Self-labels
UseSelfLabels to add self-labels to the account.
Call any API directly
WhenHasShortHand does not have a shortcut for what you need, use send() or client().
Facade vs. direct container access
Bluesky::post() and app(Factory::class)->post() operate on the same BlueskyManager instance.
scoped, the session state set by login() is preserved for the rest of the current request.
Conditionable and Macroable
BlueskyManager includes the Conditionable and Macroable traits from Laravel.
Conditionable: when() / unless()
Macroable: adding custom methods
You can extendBlueskyManager with your own methods using macro(). A common place to register macros is in AppServiceProvider::boot().
Injecting a custom agent
UsewithAgent() to set any Agent implementation directly.
In practice,
withAgent() is most useful in tests. Normal application code should use login() or withToken(), which set the agent automatically.Related pages
- Authentication methods — App Password vs. OAuth details
- Basic client — API operation examples after authentication
- Testing — Using the fake for tests
- Source: src/BlueskyManager.php
- Source: src/HasShortHand.php