Skip to main content

Event types

Definition
Register handlers with reactor.on(event, handler) and remove them with reactor.off(event, handler).

statusChanged

Fired when the connection status changes. Payload: ReactorStatus
Example

message

Fired when the model sends an application-level message. Payload: any. Shape depends on the model.
Example

trackReceived

Fired when a named media track is received from the model. Payload: (name: string, track: MediaStreamTrack, stream: MediaStream, mid: string | undefined)
Example
For React apps, use ReactorView instead. It handles this event automatically.

error

Fired when an error occurs. The same typed ReactorError a rejected/thrown call would carry. Payload: ReactorError
Example
See ReactorError for all fields and error codes.

sessionIdChanged

Fired when the session ID changes, typically on connect or disconnect. Payload: string | undefined

statsUpdate

Fired every 2 seconds with WebRTC connection statistics while connected. Payload: ConnectionStats
Example
See ConnectionStats for all fields.

capabilitiesReceived

Fired when the model’s capabilities are received after session creation. Contains track definitions, available commands, and other model metadata. Payload: Capabilities
Example
See Capabilities for the full type.

schemaReceived

Fired once the model’s command schema is fetched, on the first "ready" transition. Most applications don’t need this — it’s cached and readable synchronously via getSchema(). Payload: ModelSchema
Example

runtimeMessage

Fired when the platform sends an internal, platform-scoped message. Not needed for most applications — use message for model-originated payloads. Payload: any