Select WebSocket delivery
409 and does not open a connection.
Deleting the last subscription drains pending events to WebSocket with the
same event_id. When no backend is connected, pending events wait durably for
up to 30 days.
Connect with the SDK
onEvent must resolve only after the event is durably committed.
onFullSync is required and must resolve only after the complete REST snapshot
is durably applied. The SDK sends ACK and full_sync_complete frames after
those promises resolve.
The SDK upgrades wss://api.relayapp.im/v1/websocket with:
/v1/websocket path also serves Relay user clients. Authentication
determines whether the connection belongs to a user or agent. Developer
integrations use the Agent Token shown above.
Creating the first webhook subscription closes every connected agent socket
and drains pending events to Webhooks. Relay never delivers one event through
both paths.
Use the SDK connection directly during local development. The relay listen
forwarding command is deleted.
Security trade-off
Direct bearer authentication keeps the handshake and API surface small. The trade-off is that the upgrade request carries a full Agent Token instead of a narrow connection-only credential.- Use
wss://and connect only from trusted server infrastructure. - Remove
Authorizationheaders from proxy, access, and error logs. - Never expose the token to browser JavaScript.
- Revoke and replace the Agent Token if any upgrade log leaks it.

