Realtime API · Protocol
Realtime protocol reference
This page describes what browsers, mobile apps and your own servers speak to a Realtime server. It is the Pusher Channels protocol 7 with Hubfly space v1 additions. To create servers, apps and keys, use the Realtime Dashboard API instead.
Endpoints on a server
Every server has one hostname, shown in the Dashboard as the server's connection details (for example <slug>.rt.hubfly.app). Sockets use wss:// and the server API uses https:// on the same host.
| Surface | Path | Speaks |
|---|---|---|
| Pusher socket | GET /app/{key} (WebSocket) | Pusher Channels protocol 7: pusher-js, Laravel Echo, mobile SDKs. |
| Hubfly space socket | GET /hubfly/v1/app/{key} (WebSocket) | Protocol 7 plus the Hubfly space v1 extensions (@hubfly/realtime). |
| Server API | /apps/{app_id}/… | Pusher HTTP API plus /apps/{app_id}/hubfly/v1/…, all Pusher-signed. |
| Inspector | GET /hubfly/v1/inspect (WebSocket) | Debug console stream used by the Dashboard and the CLI. |
| Liveness | GET /hubfly/v1/health | 200 {"ok":true} while the server accepts work, 503 while it drains. |
Not supported in v1: watchlists, HTTP or SockJS fallback transports, permessage-deflate, binary frames, and the Pusher cluster host scheme. Clients must set the host; thecluster option is only a placeholder.
Who can connect
/apps/…) only. WebSocket clients are never IP-restricted; use the app's allowed origins, channel authorization and user sign-in to control them.Names and limits
| Item | Rule |
|---|---|
| App id | Digits, ^[1-9][0-9]{0,19}$ |
| App key | ^[a-z0-9]{20}$ |
| Channel name | 1–200 characters from [-a-zA-Z0-9_=@,.;]; # only in #server-to-user-{user_id} |
| Event name | 1–200 characters; the pusher:, pusher_internal: and hubfly: prefixes are reserved |
| User id | 1–128 characters from [-a-zA-Z0-9_=@,.;] |
| Socket id | ^[1-9][0-9]{9}\.[1-9][0-9]{9}$, randomly generated |
| Message id | m_ plus 26 Crockford base32 characters when the server generates it; your own ids are 1–64 characters from [A-Za-z0-9_.:-] |
| Payload | data up to the app's effective maximum message size (the server size's 32–256 KiB unless the app lowers it) |
| Frame | Payload limit + 4 KiB; a larger frame closes the socket with 1009 |
| Channels per connection | The app's effective maximum (default 100) |
| Presence members | The app's effective maximum per channel (default 100, at most 1,000) |
Channel types come from the name prefix:
| Prefix | Type |
|---|---|
private-encrypted- | Encrypted channel |
private- | Private channel |
presence- | Presence channel |
#server-to-user- | User channel |
| anything else | Public channel |
A cache- prefix after the type prefix (cache-, private-cache-,private-encrypted-cache-, presence-cache-) makes it a cache channel.
Connecting
wss://<host>/app/{key}?protocol=7&client=js&version=8.4.0&flash=falseThe server reads protocol (5 to 7 are accepted) and uses client andversion for metrics only. It checks the connection in this order. Only capacity problems fail before the WebSocket upgrade; every other check upgrades and then closes with the code, as Pusher does.
| Check | Result |
|---|---|
| Server draining or at its connection limit, or memory above 90% of its limit | HTTP 503 with Retry-After: 2 (no upgrade) |
protocol missing / malformed / unsupported | Close 4008 / 4006 / 4007 |
| Unknown key, or a retiring key past its expiry | Close 4001 |
| App disabled | Close 4003 |
Origin not in the app's allowed origins (an empty list allows every origin; requests without an Origin header are allowed, so native and server clients work) | Close 4009 |
| App at its connection limit | Close 4100 |
Then the server sends:
{"event":"pusher:connection_established","data":"{\"socket_id\":\"1234567890.1234567890\",\"activity_timeout\":120}"}data is a JSON-encoded string in every server event except pusher:error,pusher:subscription_error and pusher:pong, whose data is an object. Client frames may send data as an object or a string.
Keep-alive and close codes
After activity_timeout seconds of silence the client sends{"event":"pusher:ping","data":{}} and the server answerspusher:pong. The server sends its own pusher:ping after 120 seconds without any client frame and closes with 4201 if nothing arrives within 30 seconds. WebSocket ping and pong control frames also count as activity.
| Code | pusher-js action | When |
|---|---|---|
4001 | Stop | Unknown app or key, app deleted or key revoked while connected |
4003 | Stop | App disabled |
4009 | Stop | Origin not allowed; user sign-in failed, or the app requires sign-in and none arrived within 30 s; connection terminated through the API or the console |
4100 | Back off | Over capacity (server or app connection limit), slow consumer (send queue above 256 KiB or 512 messages), or bandwidth budget exhausted for 10 s |
4200 | Reconnect now | Planned restart or drain; console "disconnect" |
4201 | Reconnect now | Ping not answered |
1009 | — | Frame too large |
Channels and authorization
{"event":"pusher:subscribe","data":{"channel":"private-orders","auth":"<key>:<hex>","channel_data":"…"}}| Channel | auth |
|---|---|
| Public | Ignored |
| Private, encrypted | <key>:HMAC-SHA256-hex(secret, "<socket_id>:<channel>") |
| Presence | <key>:HMAC-SHA256-hex(secret, "<socket_id>:<channel>:<channel_data>"); channel_data is a JSON string {"user_id":"…","user_info":{…}} (user_info optional, at most 1 KiB) |
#server-to-user-{id} | Ignored; allowed only when the connection is signed in as {id} |
<key> may be any active key of the app, or a retiring key that has not expired. Your own server computes these signatures with the app secret: pusher-js and Laravel Echo call your authorization endpoint, never Hubfly space. Keep the secret on the server.
import { createHmac } from "node:crypto";
const sign = (secret, value) => createHmac("sha256", secret).update(value).digest("hex");
// Private and private-encrypted channels
const auth = `${key}:${sign(secret, `${socketId}:${channel}`)}`;
// Presence channels: sign the exact channel_data string you return
const channelData = JSON.stringify({ user_id: "u_1", user_info: { name: "Ann" } });
const presence = {
auth: `${key}:${sign(secret, `${socketId}:${channel}:${channelData}`)}`,
channel_data: channelData,
};
// User sign-in (pusher:signin)
const userData = JSON.stringify({ id: "u_1", user_info: { name: "Ann" } });
const signin = {
auth: `${key}:${sign(secret, `${socketId}::user::${userData}`)}`,
user_data: userData,
};Success:
{"event":"pusher_internal:subscription_succeeded","channel":"private-orders","data":"{}"}
{"event":"pusher_internal:subscription_succeeded","channel":"presence-room","data":"{\"presence\":{\"ids\":[\"u_1\"],\"hash\":{\"u_1\":{\"name\":\"Ann\"}},\"count\":1}}"}On failure the channel stays unsubscribed and the connection stays open. The server answers with a channel-scoped event, which pusher-js 8.x and Laravel Echo handle:
{"event":"pusher:subscription_error","channel":"private-orders","data":{"type":"AuthError","error":"Invalid signature","status":401}}type / status | Meaning |
|---|---|
AuthError / 401 | Bad or missing signature |
LimitReached / 429 | Channels per connection or presence members exceeded |
InvalidChannel / 400 | Bad channel name |
Forbidden / 403 | Another user's channel, or sealed presence data required by the app's encryption policy |
- Subscribing again to a subscribed channel is a no-op that answers
subscription_succeededagain. Unsubscribe with{"event":"pusher:unsubscribe","data":{"channel":"private-orders"}}(no answer). - Presence:
pusher_internal:member_added({"user_id","user_info"}) when a user's first connection joins andpusher_internal:member_removed({"user_id"}) when the last one leaves, sent to the other members only. - When the app enables subscription count events, subscribers of non-presence channels receive
pusher_internal:subscription_countwith{"subscription_count":3}when the count changes, at most once per second per channel. - Cache channels keep their last event for 30 minutes. Right after
subscription_succeededa subscriber receives the cached event, orpusher:cache_miss(and thecache_misswebhook fires).
Events and client events
{"event":"order.updated","channel":"orders","data":"{\"id\":1}"}
{"event":"client-typing","channel":"presence-room","data":"{…}","user_id":"u_1"}
{"event":"notice","channel":"#server-to-user-u_1","data":"{…}"}
{"event":"order.updated","data":"{\"id\":1}"}The last form has no channel: it is a direct message to one connection. pusher-js delivers channel-less events through pusher.bind(event) and pusher.bind_global.
Client events ({"event":"client-typing","channel":"private-room","data":{…}}) are accepted only when the app enables them, on private and presence channels the sender is subscribed to, up to the app's per-connection rate. They are not echoed to the sender, and presence channels add user_id. Pusher clients cannot send them on encrypted channels; the Hubfly space socket can, with an end-to-end encryption envelope. Refusals are an error event, not a close:
{"event":"pusher:error","data":{"code":4301,"message":"Client event rejected due to rate limit"}}
{"event":"pusher:error","data":{"code":null,"message":"Client events are not enabled for this app"}}User sign-in
{"event":"pusher:signin","data":{"auth":"<key>:<hex>","user_data":"{\"id\":\"u_1\",\"user_info\":{…}}"}}hex = HMAC-SHA256-hex(secret, "<socket_id>::user::<user_data>"), whereuser_data is a JSON string with a string id. Success ispusher:signin_success; failure is pusher:error with code 4009 followed by close 4009. A connection signs in at most once.
After signing in, a client subscribes to #server-to-user-{id} (pusher-js and the Hubfly space SDK do this automatically) and receives user messages there. User messages count only connections subscribed to that channel: a signed-in connection that has not subscribed is listed by GET …/users/{id}, but a send to the user reports offline.POST /apps/{id}/users/{user_id}/terminate_connections closes every connection of the user with 4009.
Hubfly space v1 extensions
The Hubfly space socket (/hubfly/v1/app/{key}) has the same checks, frames and semantics as the Pusher socket, plus the additions below. None of them is ever sent on/app/{key}. A client that cannot reach the Hubfly space path can fall back to/app/{key} and lose only the additions.
Hello and sessions
The client speaks first, within 10 seconds (otherwise close 4009):
{"event":"hubfly:hello","data":{"v":1,
"resume":{"socket_id":"1234567890.1234567890","token":"<session token>"},
"channels":{"orders":{"epoch":"e7k2m9","offset":41}},
"features":["ack","offsets"]}}resume and channels are optional. pusher:connection_established then adds a hubfly member:
{"socket_id":"1234567890.1234567890","activity_timeout":120,
"hubfly":{"v":1,"session_token":"<new token>","resumed":true,"detach_ttl":60,"server_time":1760600000000}}- Sessions. A Hubfly space connection that ends abnormally (no close frame, 1001/1006, 4200, 4201, a drain) leaves its session detached for the app's detach TTL (default 60 s, at most 300 s). A detached session keeps its socket id, sign-in, subscriptions and presence membership (no
member_removedwhile detached) and buffers up to 100 direct and user messages / 256 KiB; overflow drops the oldest and is reported asdropped. A clean close (1000 from the client) ends the session at once. - Resume.
resume.tokenmust match the session's current token; it rotates on every resume. The new socket takes over the session, keeps the socket id and earlier authorization, and must not resubscribe. The server replays, per channel, the messages after the client's offset, re-sends presence data that changed, delivers buffered direct and user messages, then sendshubfly:resumed. If the session is unknown or expired,resumedis false, the socket id is new, and the client resubscribes. - Planned restarts keep sessions: clients resume after the restart.
{"event":"hubfly:resumed","data":{"channels":{"orders":{"status":"recovered","from":41,"to":45}},
"messages":{"replayed":3,"dropped":0}}}Offsets and recovery
On the Hubfly space socket, messages on channels that keep history carry their position, and every message carries its id:
{"event":"order.updated","channel":"orders","data":"{…}","hubfly":{"e":"e7k2m9","o":42,"m":"m_01HZX…"}}Each channel stream has an epoch (random; it changes when continuity was lost) and an offset that counts up within the epoch. A subscribe can ask to recover from a position:
{"event":"pusher:subscribe","data":{"channel":"orders","auth":"…","hubfly":{"since":{"epoch":"e7k2m9","offset":41}}}}subscription_succeeded then adds"hubfly":{"epoch":"e7k2m9","head":45,"recovery":"recovered","reason":null,"replayed":4}and the replayed messages follow it, before any live message, without duplicates or gaps.recovery is recovered (everything after since was replayed),gap (same epoch, but some messages had expired) or failed with areason of epoch_changed, expired, overflow (more than 1,000 to replay) or history_off. On failed nothing is replayed and the application must refetch its state.
History is configured per app: off, memory (lost on restart) ordurable (stored on the server's volume; the default keeps 120 seconds / 100 messages). When the volume has less than 10% free space, durable history degrades to memory only. A clean drain keeps epochs; a crash changes every epoch, so offsets are never reused.
Direct and user messages
{"event":"order.updated","data":"{…}","hubfly":{"k":"direct","m":"m_01HZX…","ack":true}}
{"event":"notice","channel":"#server-to-user-u_1","data":"{…}","hubfly":{"k":"user","m":"m_01HZY…"}}The client acknowledges after handling: {"event":"hubfly:ack","data":{"m":["m_01HZX…"]}}(up to 100 ids per frame). Acknowledged messages leave session buffers and offline queues, their receipt becomes acked, and the hubfly.message_delivered webhook fires. When the app enables the offline queue, user messages sent while the user has no connection or detached session are kept and delivered after the user's next sign-in, once it subscribes to#server-to-user-{id}.
Planned reconnects and connection ids
Before a planned drain the server may send{"event":"hubfly:reconnect","data":{"after_ms":1234,"reason":"restart"}}; the client waits after_ms, closes with 4200 and resumes.
The server only knows socket ids. With end-to-end encryption enabled, the SDK gives the application a connection id of the form <socket_id>~<k>, where k is a 32-byte key the client generated locally (base64url, no padding). The application passes this id to its own server, which encrypts direct messages with k and routes them by the socket id part. Hubfly space never sees k. Without end-to-end encryption the connection id is the socket id.
Server API: signing requests
Every /apps/{app_id}/… request carries these query parameters:auth_key, auth_timestamp (Unix seconds, within ±600 s),auth_version=1.0, body_md5 (lower-case hex MD5 of the raw body; required when the body is not empty) andauth_signature = HMAC-SHA256-hex(secret, "<METHOD>\n<path>\n<query>").<query> is every other parameter with lower-cased keys, sorted by key, joined askey=value with &, values not URL-escaped. The key must belong to{app_id}.
This is Pusher's request signing, so Pusher server libraries and @hubfly/realtime/serversign for you once they point at your server's host. To sign by hand:
import { createHash, createHmac } from "node:crypto";
// Signs a server API request. baseUrl is https://<host> (HUBFLY_REALTIME_URL).
function signedUrl({ baseUrl, key, secret, method, path, body = "", query = {} }) {
const params = {
...query,
auth_key: key,
auth_timestamp: String(Math.floor(Date.now() / 1000)),
auth_version: "1.0",
};
if (body) params.body_md5 = createHash("md5").update(body).digest("hex");
// Lower-cased keys, sorted, joined as key=value with "&", values not escaped
const pairs = Object.entries(params)
.map(([name, value]) => [name.toLowerCase(), String(value)])
.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
const canonical = pairs.map(([name, value]) => `${name}=${value}`).join("&");
const signature = createHmac("sha256", secret)
.update(`${method}\n${path}\n${canonical}`)
.digest("hex");
const search = new URLSearchParams([...pairs, ["auth_signature", signature]]);
return `${baseUrl}${path}?${search}`;
}
const body = JSON.stringify({ name: "order.updated", channels: ["orders"], data: JSON.stringify({ id: 1 }) });
const url = signedUrl({
baseUrl: process.env.HUBFLY_REALTIME_URL,
key: process.env.HUBFLY_REALTIME_KEY,
secret: process.env.HUBFLY_REALTIME_SECRET,
method: "POST",
path: `/apps/${process.env.HUBFLY_REALTIME_APP_ID}/events`,
body,
});
await fetch(url, { method: "POST", headers: { "Content-Type": "application/json" }, body });Errors are JSON {"error":"…"}:
| Status | When |
|---|---|
400 | Malformed JSON, invalid names, too many channels or events |
401 | Missing or unknown key, bad signature, timestamp outside ±600 s, body_md5 mismatch, query names differing only in case, or an auth parameter given twice |
403 | App disabled, or the app's encryption policy ({"error":"…","reason":"e2e_required"}) |
404 | Unknown path, app or resource |
413 | Body above the payload limit + 16 KiB, or data above the payload limit |
429 | Rate limited (Retry-After in seconds) |
503 | Draining (Retry-After: 2), or too many request bodies in flight (Retry-After: 1) |
The signature is verified before the body is read. Bodies are limited to the payload limit + 16 KiB, or 100 × that (at most 10 MiB) for batch_events. The app's publish rate counts every published or sent event (a batch counts each of its events), with a burst of twice the rate.
Server API: Pusher endpoints
| Method and path | Body or query | Response |
|---|---|---|
POST /apps/{id}/events | {"name","data","channels":[…] or "channel","socket_id?","info?"}; 1–100 channels; data is a string (other JSON values are re-encoded as a string) | {}; with info=subscription_count,user_count: {"channels":{"<name>":{"subscription_count":3,"user_count":2}}} |
POST /apps/{id}/batch_events | {"batch":[{"channel","name","data","socket_id?","info?"}]}, up to 100 events | {} or {"batch":[…]} |
GET /apps/{id}/channels | filter_by_prefix?, info?=user_count,subscription_count (user_count needs filter_by_prefix=presence-) | {"channels":{"<name>":{}}} (occupied channels only) |
GET /apps/{id}/channels/{name} | info?=user_count,subscription_count (user_count for presence only) | {"occupied":true,"subscription_count":3,"user_count":2} |
GET /apps/{id}/channels/{name}/users | Presence channels only | {"users":[{"id":"u_1"}]} |
POST /apps/{id}/users/{user_id}/terminate_connections | {} | {} |
socket_id excludes that connection from the delivery. Publishing to#server-to-user-{id} through events is how Pusher server libraries implement sendToUser; it is a user message.
Server API: Hubfly space endpoints
These live under /apps/{id}/hubfly/v1/ and are signed exactly like the Pusher endpoints (the signed path includes the /apps/{id} prefix), so Pusher libraries can call them with their generic get and post helpers.
| Method and path | Body or query | Response |
|---|---|---|
POST …/send | {"socket_ids":[…]?,"user_ids":[…]?,"event","data","message_id?","ack?":false}; 1–100 targets in total; data may be any JSON value | {"message_id","results":[{"socket_id","status"},{"user_id","status","connections":2}]} |
POST …/publish | {"channels":[…],"event","data","message_id?","socket_id?"} | {"message_id","channels":{"orders":{"epoch":"e7k2m9","offset":43}}} ({} for channels without history) |
GET …/connections/{socket_id} | {"socket_id","online":true,"state":"connected","user_id":"u_1","connected_at":"…","protocol":"hubfly"}; a detached session reports "online":false,"state":"detached" and expires_at; unknown: 404 {"online":false} | |
POST …/connections/{socket_id}/terminate | {"mode?":"terminate"}: terminate (default) closes with 4009 so the client stops; disconnect closes with 4200 so it reconnects at once | {"terminated":true}; unknown: 404 {"terminated":false} |
GET …/users/{user_id} | {"user_id","online":true,"connections":2,"socket_ids":["…"]}; counts live connections only | |
GET …/history/{channel} | since?, epoch?, limit? (at most 1,000) | {"channel","epoch","head","oldest","messages":[{"offset","event","data","message_id","published_at","user_id?"}],"truncated":false,"gap":false} |
GET …/messages/{message_id} | {"message_id","created_at","event","targets":[{"socket_id","status","updated_at"}]} |
Send statuses: delivered (queued on at least one live connection), buffered(the target session is detached; delivered on resume), queued (the user is offline and the message is in the offline queue; "connections":0) and offline (nothing to deliver to; dropped). Receipts add acked, expired (buffer or queue TTL passed) and dropped (buffer overflow), and are kept for one hour.
Send a message_id on every send and publish
message_id is an idempotency key: within 5 minutes, repeating a send orpublish with the same id for the same app returns the first result and delivers nothing again, even if the channels or targets differ. Use a new id per logical message. A POST can be retried once when an upstream connection resets, so Pusher's events endpoint, which has no message id, can deliver twice in that case.Webhooks
The server POSTs batches of events to each webhook URL configured for the app:
{"time_ms":1760600000000,"events":[{"name":"channel_occupied","channel":"orders"}]}| Event | Fields | Fires |
|---|---|---|
channel_occupied / channel_vacated | channel | First subscriber / last unsubscribe (vacated waits 5 s and is dropped if the channel is re-occupied) |
member_added / member_removed | channel, user_id | First / last connection of a user in a presence channel (member_removed waits for detached sessions to expire) |
client_event | channel, event, data, socket_id, user_id? | Every client event |
cache_miss | channel | A cache-channel subscribe without a cached event |
subscription_count | channel, subscription_count | Count changes on non-presence channels (at most once per second per channel), only when the app enables subscription count events |
hubfly.connection_opened / hubfly.connection_closed | socket_id, user_id?, protocol, code?, duration_ms? | Connection start / end (a resumed session does not reopen) |
hubfly.user_online / hubfly.user_offline | user_id | First signed-in connection / last session (live or detached) gone |
hubfly.message_delivered | message_id, socket_id?, user_id?, status: "acked" | Acknowledged direct and user messages |
hubfly.test | The webhook test action only |
Each request carries these headers:
| Header | Value |
|---|---|
Content-Type | application/json |
X-Pusher-Key | The app key the webhook signs with |
X-Pusher-Signature | HMAC-SHA256-hex(secret, body), the Pusher format, so Pusher libraries' webhook validators work |
X-Hubfly space-Delivery-Id | wd_…; deduplicate on it |
X-Hubfly space-Signature | t=<unix seconds>,v1=HMAC-SHA256-hex(secret, "<t>.<body>") |
User-Agent | hubfly-realtime-webhooks/1 |
import { createHmac, timingSafeEqual } from "node:crypto";
// rawBody: the exact request body bytes as a string.
// header: the X-Hubfly space-Signature value, "t=<unix seconds>,v1=<hex>".
// secret: the secret of the app key named in X-Pusher-Key.
export function verifyHubflyWebhook(rawBody, header, secret, toleranceSeconds = 300) {
const fields = Object.fromEntries(
header.split(",").map((part) => {
const index = part.indexOf("=");
return [part.slice(0, index).trim(), part.slice(index + 1).trim()];
}),
);
const timestamp = Number(fields.t);
if (!Number.isInteger(timestamp)) return false;
// Reject old timestamps so a captured delivery cannot be replayed later.
if (Math.abs(Date.now() / 1000 - timestamp) > toleranceSeconds) return false;
const expected = createHmac("sha256", secret).update(`${fields.t}.${rawBody}`).digest();
const received = Buffer.from(fields.v1 ?? "", "hex");
return received.length === expected.length && timingSafeEqual(received, expected);
}- Delivery. Batches hold up to 50 events / 256 KiB, one request in flight per webhook, in order. Any 2xx within 10 seconds is success. Failures retry with exponential backoff (1 s doubling to 15 min) until 24 hours after the batch's oldest event; the batch is then
dead, kept 7 days and can be redelivered. Each attempt is signed with the key's current secret. - At least once. A delivery can arrive more than once; deduplicate on
X-Hubfly space-Delivery-Id. Each webhook queues at most 100,000 events and drops the overflow; removing a webhook drops its queued events. - Restarts. After every restart, occupancy, presence and online state are reconciled with a 30-second grace: channels, members and users that come back within it emit nothing, so a deploy whose clients reconnect does not flood your receiver.
- Egress rules. URLs must be
httpson port 443 or 8443. Private, loopback, link-local, CGNAT, multicast, documentation, metadata and unspecified addresses are refused (Hubfly space-hosted apps on the region's public address are allowed on 443). Redirects are not followed and at most 4 KiB of the response is read.
Inspector socket
wss://<host>/hubfly/v1/inspect streams live traffic to the Dashboard's debug console and hubfly realtime tail. The connection's Origin must be one the server allows, and the first frame, within 5 seconds, is{"type":"auth","token":"<inspector token>"} with a single-use token fromPOST …/realtime/inspector/token in the Dashboard API. Tokens in the URL or subprotocol are ignored. The server answers {"type":"ready",…} or closes:
| Close | Meaning |
|---|---|
4401 | Missing, invalid, expired or replayed token, or a token issued for another origin |
4403 | Origin not allowed |
4408 | No auth frame within 5 seconds |
4429 | More than 5 sessions on the server (one token subject holds at most 2) |
4409 | Replaced by a newer session of the same subject; do not reconnect automatically |
4000 | Session expired (1 hour) or the server is draining |
After authenticating, a client may send{"type":"filter","apps":["1000001"],"families":["conn","msg"],"channel_prefix":"orders"}(all fields optional) and {"type":"ping"}. Event families are conn,sub, member, msg, api, err andwebhook. Payload previews (the first 1 KiB) appear only when the token allows them, the app enables previews, and the payload is not an end-to-end encrypted envelope. With sessions open the stream carries at most 500 events per second and then samples, announced with{"type":"sampling","rate":0.25}; {"type":"dropped","count":120}reports events a slow session missed.