Release 4.19.0
What's new?
onInvalidAuth Method
Added a new onInvalidAuth delegate which gets notified when a request fails because of an invalid JWT, allowing you to renew credentials without having to call Smooch.login()
. The delegate must return a new JWT token as a string
or Promise<string>
that will resolve into the JWT.
Sample Usage
Smooch.init({
appId: '<app-id>',
delegate: {
onInvalidAuth() {
return new Promise((resolve) =>
resolve('<my-new-auth-token>')
)
}
}
});