connect

View as Markdown

connect

connect(): Promise<void>

The client automatically connects when created. You only need to call this method if you have previously disconnected.

Connects this client to the SignalWire Realtime API. The client will start receiving events.

Returns

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

Example

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