disconnect

View as Markdown

disconnect

disconnect(): Promise<void>

Disconnects this client from the SignalWire Realtime API. The client will stop receiving events and you will need to call connect() to reconnect.

Returns

Promise<void> - Resolves when the connection is closed.

Example

1import { SignalWire } from "@signalwire/realtime-api";
2
3const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" });
4
5await client.disconnect().then(() => {
6 console.log("disconnected");
7});