-
Notifications
You must be signed in to change notification settings - Fork 463
Tile Embed
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 Embed a dashboard tile. |
Power BI tiles can now be embedded into your own applications.
In order to embed a tile using javascript you will need to create an embed configuration and call powerbi.embed(). Tile embed configuration has the following options:
- type - must be 'tile'
- embedUrl - the embed url
- id - the tile id
- dashboardId - the id of the dashboard that contains the tile
- accessToken - Embed Token which allows View permissions on the tile.
- tokenType - specifies the type of the token, Aad or Embed. More details in Embed Token section.
- height - the height of the tile. by default this will be the iframe height
- width - the width of the tile. by default this will be the iframe width
Example code for embedding a tile:
<div id="tileContainer"></div>
// Get models. models contains enums that can be used.
var models = window['powerbi-client'].models;
var embedConfiguration = {
type: 'tile',
accessToken: 'H4sIAAAAAA...ATudIWLCCgAA',
id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',
embedUrl: 'https://embedded.powerbi.com/embed',
dashboardId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',
tokenType: models.TokenType.Embed
};
var $tileContainer = $('#tileContainer');
var tile = powerbi.embed($tileContainer.get(0), embedConfiguration);