Skip to content

@smooch-ci-web smooch-ci-web released this Jun 19, 2019 · 7 commits to master since this release

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>')
            )
        }
    }
});
Assets 2
You can’t perform that action at this time.