Relay.Client
Relay.Client is the basic connection to RELAY, allowing you send commands to RELAY and setup handlers for inbound events.
Constructor
Constructs a client object to interact with RELAY.
Parameters
Example
Create a Client to interact with the RELAY API.
Properties
Methods
connect
Activates the connection to the RELAY API. The connection to RELAY does not happen automatically so that you can setup handlers to events that might occur before the connection is successfully established.
Returns
Promise<void>
Example
disconnect
Disconnect the client from RELAY.
Returns
void
Example
on
Attach an event handler for a specific type of event.
Parameters
Returns
Relay.Client - The client object itself.
Example
Subscribe to the signalwire.ready and signalwire.error events.
off
Remove an event handler that were attached with .on(). If no handler parameter is passed, all listeners for that event will be removed.
Parameters
Returns
Relay.Client - The client object itself.
Example
Subscribe to the signalwire.error and then, remove the event handler.
Events
All available events you can attach a listener on.