Embedding API
- Add the link to the birst_embed.js file at the top of the HTML page, inside the head
tag. It must be on the page before the JavaScript call in Step 5.
<head> <script src="https://birst_URL/js/birst_embed.js" type="text/Javascript"></script> </head>
- In the body of the page, add the DIV element and specify a unique ID for the dashboard.
The DIV must be on the page before the JavaScript call in step 5.
<div id="BirstDash">
- In your server-side code, generate a session token (token request). See Setting Up
Single Sign On.
https://birst_URL/TokenGenerator.aspx?birst.username=user@domain.com &birst.ssopassword=ssopassword&birst.spaceId=space_ID
- In JavaScript, generate the URL for the Iframe using the Birst Single Sign On parameters. Use the token from the first call in the URL. The
birst.module must be newDashboards, for Dashboards 2.0. See SSO Parameters.
https://birst_URL/SSO.aspx?BirstSSOToken=birst_token &birst.module=newDashboards&birst.exportZoom=2&&birst.embedded=true &birst.hideDashboardNavigation=false&birst.hideDashboardPrompts=false &birst.dashboard=My%20Dashboard&birst.page=My%20Page
- In JavaScript at the end of the <body> tag, create the configuration object with
the IframeSrc for the URL to the dashboard. Then call BirstConfig.create. The first
parameter is the div id on the HTML page that holds the Iframe, and the second is the
object for the dashboard. This example shows it with fixed width and height dimensions.
If you do not provide fixed dimensions, it is responsive and automatically resizes.
var optionsDashboard={ width: "800", height: "600", iframeSrc: "https://birst_URL/SSO.aspx?BirstSSOToken=birst_token &birst.module=newDashboards&birst.exportZoom=2&&birst.embedded=true &birst.hideDashboardNavigation=false&birst.hideDashboardPrompts=false &birst.dashboard=My%20Dashboard&birst.page=My%20Page" }; BirstConfig.create("BirstDash", optionsDashboard);