Emitted on WebSocket lifecycle transitions.

Subscribe via O2WebSocket.streamLifecycle to detect reconnects and re-sync state from the REST API — messages during the disconnect window are lost.

interface ConnectionEvent {
    attempt: number;
    message: string;
    state: ConnectionState;
}

Properties

Properties

attempt: number

Reconnect attempt number (0 when not reconnecting).

message: string

Human-readable description.

The new connection state.