api.refreshToken() Exchanges the stored refresh token for a fresh access token. Throws if the user has not authorized the addon or if the refresh token has been revoked. In that case, call authorize() to re-authorize the user.
Return value - Promise<TokenResponse>
const api = window.Addon.iframe().getApiClient();
try {
const tokenResponse = await api.refreshToken();
// tokenResponse.access_token holds a fresh access token
} catch (err) {
// Refresh token missing or revoked.
// Call api.authorize() to re-authorize the user.
}