addOnTokenRefreshCallback
Receive a callback when the bearer token refreshes
You can add a callback method that will be called each time the bearer token is refreshed. This can only be used while using the Venly Connect JS authentication client. This function has one parameter: a callback function accepting one parameter (the new bearer token) and returning void.
1
venlyConnect.addOnTokenRefreshCallback(token => {
2
console.log('Refreshed bearer token: ' + token);
3
});
Copied!

Signature

1
venlyConnect.addOnTokenRefreshCallback(tokenRefreshCallback: (token: string) => void): void
Copied!

Returns

1
Promise<AuthenticationResult>
Copied!

Parameters

Parameter
Description
tokenRefreshCallback
a callback function accepting one parameter (the new bearer token) and returning void. (Required)

Example

1
venlyConnect.addOnTokenRefreshCallback(token => {
2
console.log('Refreshed bearer token: ' + token);
3
});
Copied!

Object Types

Last modified 2mo ago