Skip to content

Update Embed Token

Amit Shuster edited this page Jan 24, 2021 · 5 revisions
ℹ️ This wiki has been deprecated
All our Client APIs documentation and references can be found in the new Power BI embedded analytics Client APIs documentation set.
For the content of this article see Refresh the access token.

setAccessToken

setAccessToken can be used to update underlying Embed token without reloading the embedded report. It can be used for example if Token is expired or near expiry.

Usage Example

report.setAccessToken("eyJ0eXAiOiJKV1Qi..00YU")
  .catch(error => { ... });

getAccessToken

getAccessToken returns the current embed token.

Usage Example

var token = report.getAccessToken();

Refresh Token Example

Check Refresh token using JavaScript SDK example to see an example of embedding a report and setting a listener on token expiration by using our JavaScript SDK.