The SignalWire Client
The SignalWire Client provides access to SignalWire’s services on the browser. It provides methods to handle incoming calls, dial to addresses, and register devices for notifications.
Instantiation
The SignalWire client is instantiated using the SignalWire function.
If you’re including the @signalwire/js dependency as a script in HTML, the SignalWire function is a property of the SignalWire global variable that the script sets:
If you installed @signalwire/js from npm:
For React or React Native projects, use the community library:
Parameters
The access token for the subscriber.
The HTML container element where the SDK will display the video stream.
Callback functions for when a call is received. See IncomingCallHandlers.
Arbitrary variables that are transparent to FreeSWITCH.
You can manage the DOM yourself by not specifying a rootElement here and using the buildVideoElement function instead.
Example
Vanilla JS
React (community)
Properties
Returns the URL of the host that the client will use to make HTTP requests (like querying the list of addresses or conversations). Read-only.
Methods
Dial to an address
Go online to receive call invites
Go offline to stop receiving call invites
Get info about the current subscriber
Connect the WebSocket client
Disconnect the WebSocket client
Update the auth token
Namespaces
Certain methods and properties are organized into namespaces for clarity. They can be accessed as follows:
Methods for working with addresses
Methods for chat functionality
Methods for conversations
Type aliases
IncomingCallHandlers
Use this object to assign callback functions which get invoked when a call is received.
IncomingCallNotification
The object passed into the IncomingCallHandlers callback with the call description and controls.
IncomingInvite
CallOptions
MediaStreamConstraints
CallFabricRoomSession
Extends RoomSession.