Overview
laravel-bluesky provides two WebSocket commands for connecting to Bluesky’s real-time streams.
- Jetstream — Bluesky’s own filtered WebSocket endpoint. Delivers JSON messages and supports collection and DID filtering.
- Firehose — The raw AT Protocol event stream. Delivers every event on the network in DAG-CBOR binary format.
Installation
WebSocket support requires Workerman.Jetstream
Overview
Jetstream is Bluesky’s managed WebSocket service. You can filter by collection type or user DID, so your process only receives the events you care about.Start the command
Collection filter
Use-C to restrict which collections you receive. Pass the flag multiple times for multiple collections.
DID filter
Use-D to receive events from specific users only.
Event handling
The Jetstream command fires Laravel events based on the message kind.
Create a listener to handle events.
Firehose
Overview
Firehose is the raw AT Protocol event stream. It delivers every record operation on the Bluesky network as a binary DAG-CBOR payload. The package decodes the binary data automatically, so your listeners receive standard PHP arrays.DAG-CBOR decoding is handled by the package. Your event listeners receive decoded PHP arrays.
Start the command
Event handling
The Firehose command fires the following Laravel events.Configuration
Adjust the host and logging settings inconfig/bluesky.php.
.env overrides:
Combining with Labeler
You can run the Labeler server alongside Jetstream or Firehose to feed incoming events directly into your labeling logic.Running as a long-lived process
WebSocket commands must run continuously. Use a process manager such as Supervisor to keep them alive.Supervisor configuration
/etc/supervisor/conf.d/bluesky-jetstream.conf:
Laravel Forge daemon
In Laravel Forge, add a daemon from the Daemons section.- Command:
php artisan bluesky:ws start -C app.bsky.feed.post - Directory:
/var/www/html - User:
forge
Laravel Cloud background process
Because these commands act as WebSocket clients that connect to Bluesky’s streams (rather than WebSocket servers), they run on Laravel Cloud. Configure them as custom workers in the Laravel Cloud background processes settings. Add a Custom Worker for each command you want to run. For Jetstream:Laravel Cloud automatically handles process lifecycle during deployments. No additional configuration beyond adding the background process is required.
Tips
- With
autorestart=true, Supervisor restarts the process automatically if it crashes. - Consider periodic restarts to prevent memory growth over time.
- For the high-volume Firehose stream, dispatch a Queue Job from your listener instead of processing inline.
Source: src/Console/WebSocket