Lifecycle
destroy()
Shuts down the SDK and releases all connections.
js
await SDK.destroy();- Closes WebSocket and streaming connections
- Resets status to
IDLE - Clears message list and signal state
- Detaches remote logger
WARNING
destroy() is an asynchronous function. You must use await.
Calling destroy() in an inactive state (IDLE) is ignored. Event callbacks are preserved after destroy(), so you don't need to re-register them on re-initialization.
Reconnection
If you need to reconnect, use destroy() followed by init().
js
await SDK.destroy();
await SDK.init(options);Lifecycle Flow
State Transitions
SDKStatus
| Value | Description |
|---|---|
IDLE | Initial/reset state |
CONNECTING | HTTP validation + WebSocket connecting |
CONNECTING_FAILED | Connection failed (reverts to IDLE) |
SOCKET_CONNECTED | WebSocket connection complete |
SOCKET_FAILED | WebSocket connection failed (reverts to IDLE) |
STREAMING_CONNECTED | Video+audio track reception complete |
STREAMING_FAILED | Streaming connection failed (reverts to IDLE) |
CONNECTED_FINISH | All connections complete. Ready to use |