Skip to content

@signalwire/js v3.23.0

Compare
Choose a tag to compare
@rsowald rsowald released this 21 Jul 18:53
· 315 commits to main since this release
84d40b3

Version 3.23 of the JavaScript SDK introduces the groundwork for SignalWire's upcoming UCaaS offering Call Fabric.

Improvements

  • Initial changes to set up a global SignalWire client. 65b0eea5 This will allow users to access Call Fabric to create calls outside of a namespace as they currently do with a Voice.Client or Video.Client.
  • Added a user-defined refresh token function called onRefreshToken to update an access token. b44bd6fb This is a method on the SignalWire client mentioned above.
client = await SignalWire({
      host: document.getElementById('host').value,
      token: document.getElementById('token').value,
      rootElement: document.getElementById('rootElement'),
      onRefreshToken: async () => {
        // Fetch the new token and update the client
        const newToken = await fetch('/foo') 
        await client.updateToken(newToken)
      },
    })

When the access token is expiring, onRefreshToken will be called to fetch and set a new token without interruption to the client's operation.