Skip to main content

Event model

The events channel is your realtime stream for call state updates. Core events:
  • incoming_call
  • call_answered
  • call_ended
  • call_participant_joined
  • call_participant_left
  • call_transcript_delta
  • call_transcript_completed
  • call_ai_audit_event

Authentication model

Use short-lived session_token values minted by your backend. Do not connect browser sockets with publishable keys. Use callUuid as your primary key in client state.

Bootstrap + realtime merge

  1. Load initial call rows from your backend.
  2. Subscribe to realtime events with joinEventsChannel().
  3. Apply event deltas to local cache by callUuid.
  4. Re-fetch on important transitions.

Minimal reducer pattern

Practical tips

  • Keep event handlers idempotent.
  • Re-mint session tokens on reconnect failures.
  • Handle socket setup failures gracefully and keep UI usable.
  • Session token flow: /guides/realtime-session-tokens
  • Getting started flow: /guides/getting-started-classic
  • RPC action details: /sdk-js/rpc-actions