This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi,
I had embedded the report on my web page.
But my embed token will expire after 1 hour, so I need to keep to generate the token in Powershell.
Then, I am trying to use javascript SDK to generate embed token and refresh when the token is expired. But when I run the function, it will get an error and failed to implement the function.
The refresh token function is something like as below link:
The error is something like below:
Hi @kian0417
The 'generateEmbedToken' as shown in that Wiki example, is a placeholder for you to put your own function in.
You will need to create a function that can call into the Power BI REST API -> https://docs.microsoft.com/en-us/rest/api/power-bi/embedtoken/reports_generatetokeningroup
It sounds as though you are already using this, as you have the initial embedding process working.
There is no built-in function in the Javacript API for automatically doing this action.
Hope this helps.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |