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)
Example
For React apps, use ReactorView instead. It handles this event automatically.

error

Fired when an error occurs. 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

sessionExpirationChanged

Fired when the session expiration time is updated by the server. Payload: number | undefined. Unix timestamp of expiration, or undefined if not set.

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.

runtimeMessage

Fired when the platform sends an internal runtime message. Used by ReactorController to receive the model’s command schema. Not needed for most applications. Payload: any