RELAY JS SDK 3.23.0 Release
· One min read
We are happy to announce JavaScript SDK 3.23.0.
Upgrading is straightforward with our release process, which adheres to Semantic Versioning. Minor versions are guaranteed to not have breaking changes, so you can upgrade with confidence.
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.