Realtime
Your application holds one connection and one channel — its own — and receives every event it may see, for
every creator it is granted. Events are the same v1 envelope as the event feed and
webhooks, each with its feed cursor, so a reconnect resumes exactly where you stopped.
The session
1. Connect and say hello
The first frame must be hello. It carries your token and explicitly sets principal to "application".
The token is judged exactly as the REST API judges it: live, the application and its agency active, and its scopes
within what the application is allowed. The answer is welcome, which carries the connectionRef you use to resume.
2. Subscribe to your channel
Subscribe to partner:application:<applicationId>. It is the only channel an application may hold; any other channel
is answered denied. No presence is ever held or shown for an application.
3. Handle events and acknowledge
Each event frame carries a seq — dense per connection on your channel — and the event envelope, including its
feed cursor. Handle the event, then send a cumulative ack with that seq. An ack paces delivery and marks your
progress on this connection; it never changes a message’s status.
Every event is checked again at delivery time: your current grants, the creator’s consent and your token’s scopes must allow it, and your application and its agency must still be active. An event you may not see is not delivered.
4. Resume after a reconnect
Name the channel in hello.resume.cursors with the seq and the cursor of the last event you handled. EVVA
replays the recorded events after that cursor from the durable event feed — filtered by today’s grants —
and continues at seq + 1.
Only a feed cursor of your application that covers the whole feed resumes the channel. If the cursor is another
application’s, a webhook’s whc1. cursor or a consumer-group lease’s cursor that covers only some partitions, is past
retention, or is too far behind for realtime to replay, the server answers an error frame RESUME_REJECTED naming
the channel. Then read the event feed from your
cursor; a 410 CURSOR_EXPIRED there means a resync through the REST API. Without a cursor, a subscription starts at
“now”.
Revocation and token expiry
After a 4401, reconnect once with a fresh token. If that is refused too, stop and check the application’s
status — retrying in a loop will not help.
Close codes
error frames carry one of: INVALID_FRAME, SUBSCRIPTION_LIMIT_EXCEEDED, UNSUPPORTED_PROTOCOL_VERSION,
UNAUTHENTICATED, INTERNAL_ERROR, SESSION_REVOKED, RESUME_REJECTED, ACK_INVALID, SUBSCRIPTION_REVOKED.
When realtime is at capacity
If the realtime service is full, the WebSocket upgrade is refused with HTTP 503 and Retry-After. That is not an
authentication failure: wait at least Retry-After plus some random jitter, then reconnect with the same resume
request.
Use an SDK
The official SDKs implement all of the above — hello, subscribe, ack after your handler, ping, reconnect with
full-jitter backoff, resume by cursor, a single retry with a fresh token after 4401 — and combine realtime with the
feed so a gap is always filled.
WebTransport is available in the Go SDK. The PHP SDK uses WebSocket only; the semantics are identical.
