Realtime Client
Deprecated
It’s no longer needed to create the client manually. You can use the product constructors, like Video.Client, to access the same functionality.
A real-time Client. To construct an instance of this class, please use createClient.
Example usage:
Properties
Methods
connect
- connect():
Promise<RealtimeClient>
Connects this client to the SignalWire network.
As a general best practice, it is suggested to connect the event listeners before connecting the client, so that no events are lost.
Returns
Promise<RealtimeClient>
Upon connection, asynchronously returns an instance of this same object.
Example
disconnect
- disconnect():
void
Disconnects this client from the SignalWire network.
Returns
void
off
- off(
event,fn?)
Remove an event handler.
Parameters
on
- on(
event,fn)
Attaches an event handler to the specified event.
Parameters
once
- once(
event,fn)
Attaches an event handler to the specified event. The handler will fire only once.
Parameters
removeAllListeners
- removeAllListeners(
event?)
Detaches all event listeners for the specified event.