Skip to navigation

disconnect

View as MarkdownOpen in Claude
disconnect(): Promise<void>

Disconnects the WebSocket and tears down the current session.

Ends the session and clears its persisted resume state (authorization state and protocol) and attach records together, so a later connect with the same credentials starts a fresh session and cannot reattach to the ended session’s calls. Credentials and device preferences are preserved — use resetToDefaults for a full wipe. To temporarily stop receiving inbound calls while keeping the session alive, use unregister instead.

The client can be reconnected by calling connect again, which creates a fresh transport and session.

Examples

await client.disconnect();