Skip to main content
Browse documentation

Guide

Realtime events

Resume project activity over an authenticated stream without replacing durable replay.

On this page
  1. Prerequisites
  2. Connect and resume
  3. Expected result
  4. Errors
  5. Next step

Prerequisites

Create a server API key or bounded client access token with events:read. Persist the last acknowledged cursor and plan for reconnects, network changes, and temporary realtime degradation.

Connect and resume

Authenticate the realtime transport using the supported bearer mechanism. On reconnect, provide the last durable cursor and process events in order.

text
cursor = load_last_cursor()
connect(access_token, after=cursor)
for event in stream:
  process_idempotently(event.id)
  save_cursor(event.cursor)

Realtime wakeups reduce latency; the event ledger remains the recovery source. Never assume one uninterrupted socket proves delivery.

Expected result

The client receives only its project and optional account allowlist. Replaying from the stored cursor returns the same durable event identity without exposing sibling-project activity.

Errors

  • 401 unauthorized means the credential is missing or expired.
  • A cursor older than retention requires application reconciliation.
  • Connection loss should trigger bounded backoff, then durable replay.

Next step

Add idempotent event handling and compare the latest cursor during operational health checks.