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
SignalWireclient.65b0eea5This will allow users to access Call Fabric to create calls outside of a namespace as they currently do with aVoice.ClientorVideo.Client. - Added a user-defined refresh token function called
onRefreshTokento update an access token.b44bd6fbThis is a method on theSignalWireclient 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.