Skip to main content

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.
WebSocket commands are long-running processes that require a VPS, EC2, or any always-on server, or a Laravel Cloud custom worker. They do not work on serverless platforms such as Laravel Vapor or Vercel.

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.
FeatureDetails
FormatJSON
FilteringFilter by collection and DID
VolumeLow to moderate (depending on filters)
Use caseMonitor posts, likes, follows, etc.

Start the command

Collection filter

Use -C to restrict which collections you receive. Pass the flag multiple times for multiple collections.
Common collections:
CollectionContent
app.bsky.feed.postPost create / delete
app.bsky.feed.likeLikes
app.bsky.feed.repostReposts
app.bsky.graph.followFollows
app.bsky.graph.blockBlocks

DID filter

Use -D to receive events from specific users only.

Event handling

The Jetstream command fires Laravel events based on the message kind.
Event classWhen fired
JetstreamMessageReceivedEvery received message
JetstreamCommitMessageRecord create, update, or delete
JetstreamIdentityMessageIdentity events (handle changes, etc.)
JetstreamAccountMessageAccount activation or deactivation
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.
FeatureDetails
FormatDAG-CBOR binary (decoded automatically)
FilteringNone — receives all events
VolumeVery high
Use caseFull data collection, archiving
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.
Event classWhen fired
FirehoseMessageReceivedEvery received message (includes raw binary)
FirehoseCommitMessageRecord create, update, or delete
FirehoseIdentityMessageIdentity events
FirehoseAccountMessageAccount events
FirehoseSyncMessageRepository sync events

Configuration

Adjust the host and logging settings in config/bluesky.php.
Example .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:
For Firehose:
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.
Last modified on April 25, 2026