Events & Real-time
Almost everything that happens in Cortex emits a domain event: a session starts, a message is transcribed, a participant joins, a sanction is created, an invitation is accepted. These events are the backbone of real-time integrations — and they’re all drawn from a single catalog.
One catalog, three delivery surfaces
You choose how to receive events based on what you’re building:
Durable, retried, signed delivery to your backend. Best for server-to-server.
A live stream for dashboards and UI. The SDK’s watch() is built on this.
Run your own code on each event with named on<Event> handlers.
The event envelope
Every event shares the same envelope:
The payload is action-typed. On an updated event, changes carries the old values
of the fields that changed — so you can tell what actually changed without diffing against
your own copy.
See the Domain Events reference for the full list of event types and their payloads.
Server-Sent Events (SSE)
For live UI, open an SSE stream and receive events as they happen. The simplest way is the
SDK’s watch(), which loads the current state over REST and then keeps it in sync over
SSE — no manual EventSource, filtering or merge logic:
watch() works for collections and single objects, and resilient reconnection is handled
for you — every reconnect re-syncs state so you’re never left stale. See the
Real-time updates guide.
Subscribing from functions
In a serverless function, subscribe to an event by
exporting a handler named after it (message.created → onMessageCreated). The
subscription is derived from your exports — there’s no list to maintain.
Subscribing from webhooks
Pass the event names (or wildcards) when you create a subscription: