Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I am not sure I am in the right channel to ask question, please advise if I am in the wrong channel, thanks.
My background is that I am learning how to embed Power BI report in my React web applicaiton, and I try to use this node package "powerbi-client-react" in my application to embed report, and I try to find any solutions for this config param "accessToken", and almost all the experts in Youtube videos said that they use Azure AD for the identity authentication, I want to know is there a way for my project to embed report without using Azure AD.
For accessToken, I copy it manually by chrome console script copy(powerBIAccessToken) in powerbi.com workspace.
and I try to use this api to get embedUrl and token but always response me 403 code
My code FYI:
import React from 'react';
import { PowerBIEmbed } from 'powerbi-client-react';
import { models } from 'powerbi-client';
const Dashboard = () => {
const embedConfig = {
type: 'report',
id: '964645...b0a41f8',
embedUrl: 'https://app.powerbi.com/reportEmbed?reportId=9646...0a41f8&groupId=8f7802...857d103&w=2&config=eyJjbH..X19',
accessToken: 'eyJ0eXAiOiJKV1Q...hwKuQ',
tokenType: models.TokenType.Embed,
settings: {
panes: {
filters: {
expanded: false,
visible: true
}
},
background: models.BackgroundType.Transparent,
}
};
const eventHandlers = new Map([
['loaded', function () { console.log('====Report loaded'); }],
['rendered', function () { console.log('====Report rendered'); }],
['error', function (event) { console.log(event.detail); }]
]);
const getEmbeddedComponent = (embeddedReport) => {
window.report = embeddedReport;
};
return(
<PowerBIEmbed
embedConfig={embedConfig}
cssClassName = { "report-style-class" }
eventHandlers = { eventHandlers }
getEmbeddedComponent = { getEmbeddedComponent }
/>
);
};
export default Dashboard;
Hi @James_kyndryl ,
You can refer the following official documentation to embed Power BI item into React application:
embedConfig = {
{
type: 'report', // Supported types: report, dashboard, tile, visual, and qna.
id: undefined,
embedUrl: undefined,
accessToken: undefined, // Keep as an empty string, null, or undefined.
tokenType: models.TokenType.Embed
}
}
Best Regards
Hi Rena, thanks for your answer, but the code snippet you pasted here is just a demostrate. but I want to know how to get all the params of embedConfig, especially accessToken, I dont want to get this from Azure AD, I want to get it in another way.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
6 | |
6 | |
3 | |
2 | |
2 |
User | Count |
---|---|
5 | |
5 | |
4 | |
4 | |
3 |