WebSocket streams require a Bearer token. Create an Agent Key from the Terminal to get started.
SDKs (recommended)
The WebSocket protocol involves session bootstrapping, Pusher-compatible handshakes, and channel authorization. We strongly recommend using an official SDK instead of implementing this yourself:TypeScript SDK
Full WebSocket support with typed events and automatic reconnection.
Rust SDK
Async streams via
futures::Stream with typed payloads and auto-reconnect.- TypeScript
- Rust
Raw protocol details
The rest of this page describes the underlying WebSocket protocol. You only need this if you’re building a custom client without an SDK.How it works
There is no static WebSocket URL. The connection details are discovered dynamically through a session bootstrap call to the same REST API:1
Bootstrap a session
POST to The response includes a
/api/v2/ws/session with the streams you want to subscribe to. The response contains the WebSocket host, port, app key, and resolved subscription channels.connection object with wsHost, wsPort, appKey, and forceTls fields.2
Open WebSocket connection
Construct the WebSocket URL from the session response and connect:Wait for the
pusher:connection_established message to get your socket_id.3
Subscribe to channels
For public streams, send a
pusher:subscribe message with the channel name from the session response.For presence streams (authenticated), first authorize via POST /api/v2/ws/auth with your socket_id and channel name, then subscribe with the returned auth token.Stream discovery
Get the full catalog of available streams and their filters at any time:Stream types
Connection states
Event format
All stream events arrive as JSON with the following structure:data field contains the stream-specific payload described in the Stream Catalog.