> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # disconnect > Close the WebSocket connection cleanly. [connect]: /docs/server-sdks/reference/typescript/relay/client/connect [run]: /docs/server-sdks/reference/typescript/relay/client/run Cleanly close the WebSocket connection to SignalWire Relay. This cancels the internal ping loop, all pending JSON-RPC requests, any queued requests waiting for reconnection, and any in-progress dial operations. The client can be reconnected with [`connect()`][connect]. > **Note** > > When using [`run()`][run], disconnection happens > automatically on `Ctrl+C` or when a `SIGTERM` is received. ## **Parameters** None. ## **Returns** `Promise` ## **Example** ```typescript {19} import { RelayClient } from '@signalwire/sdk'; const client = new RelayClient({ project: process.env.SIGNALWIRE_PROJECT_ID!, token: process.env.SIGNALWIRE_API_TOKEN!, contexts: ['default'] }); await client.connect(); // Do work ... const message = await client.sendMessage({ toNumber: '+15559876543', fromNumber: '+15551234567', body: 'Hello!', }); await message.wait(); await client.disconnect(); ``` > Close the WebSocket connection cleanly.