Embedding data source enables your users to create and modify data source directly within your application.
Before you begin, ensure the following:
embedSecret is highly sensitive and should never be exposed in frontend code, browsers, or client applications.Note: You can reuse the Embed Token generated for dashboard embedding case. Due to a current limitation, Embed Tokens are generated using a dashboardId but are not dashboard-specific; they are user-specific. This limitation will be addressed in a future release.
<div> in your frontend where the data source will load.To edit an existing data source, set the mode to DataSource and call the loadDatasource() method. Ensure the embedded user has permission to edit data sources.
<body onload="embedSample();">
<div id="embed_container"></div>
<script>
function embedSample() {
var boldbiEmbedInstance = BoldBI.create({
serverUrl: "<Bold BI Server URL>",
datasourceId: "<DataSource Id>",
embedContainerId: "<Embed Container Id>",
mode: BoldBI.Mode.DataSource,
embedToken: "<Embed token generated from backend server>"
});
boldbiEmbedInstance.loadDatasource();
}
</script>
</body>To create a new data source, set the mode to Connection and call the loadDatasource() method.
Ensure the embedded user has permission to create new data sources.
<body onload="embedSample();">
<div id="embed_container"></div>
<script>
function embedSample() {
var boldbiEmbedInstance = BoldBI.create({
serverUrl: "<Bold BI Server URL>",
embedContainerId: "<Embed Container Id>",
mode: BoldBI.Mode.Connection,
embedToken: "<Embed token generated from backend server>"
});
boldbiEmbedInstance.loadDatasource();
}
</script>
</body>Note: For more information on data source members, methods, and events, refer to this link.