@signalwire/js v3.23.0
rsowald
released this
21 Jul 18:53
·
315 commits
to main
since this release
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 aVoice.Client
orVideo.Client
. - Added a user-defined refresh token function called
onRefreshToken
to update an access token.b44bd6fb
This is a method on theSignalWire
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.