Transports
WebSocket, HTTP publish and HTTP long-polling, which to use when, and WebTransport, which is planned.
The Realtime API serves every transport on one host, over TLS on port 443, so it works on networks that allow only HTTPS. All transports share the same tokens, frames and error codes.
| Transport | Endpoint | Direction | Use it for |
|---|---|---|---|
| WebSocket | wss://…/v1/ws | Both, live | Apps and browsers: publishing, subscribing, presence |
| HTTP publish | POST https://…/v1/publish | Client to server | Backends, serverless functions, scripts; clients without a socket |
| HTTP long-poll | POST https://…/v1/poll | Server to client | Receiving where WebSockets are blocked by a proxy or firewall |
| WebTransport | Planned. Not available yet |
WebSocket
The default for apps. One connection carries many topics in both directions, with live delivery, presence and token refresh. See WebSocket.
HTTP publish
A stateless POST with a token in the Authorization header and up to 64 publishes in the body. Nothing to keep
open, so it suits backends and serverless functions. It can't subscribe. See
POST /v1/publish.
HTTP long-poll
A stateless read: send cursors, get events after them, waiting up to 25 seconds for something new. Use it where
WebSockets don't get through. It doesn't count toward presence, and signals between polls are best effort. See
POST /v1/poll.
The JavaScript SDK uses WebSocket first and falls back to long-polling plus HTTP publish after repeated WebSocket failures, then tries WebSocket again later. See Connection.
WebTransport (planned)
WebTransport over HTTP/3 (QUIC) is planned as another transport for apps. It isn't available yet and has no release date; this page will say when it is. Build on WebSocket and HTTP today.
Turning transports off
A segment can refuse a transport: see Transports in the Console.