Search results

Embed a AI Assistant using an Embed Token

The AI Assistant is a securely embeddable, conversational interface that lets users ask natural-language questions inside your application and receive context-aware insights, with persistent chat history and full adherence to user permissions.

Prerequisites

Before you begin, ensure the following:

  • You have learned how to generate an Embed Authorization Token.
  • The Embed Token must always be generated on the backend server side. The embedSecret is highly sensitive and should never be exposed in frontend code, browsers, or client applications.

Note: Here we are generating a token based on the provider user permission and not dashboard embedding specific. This token can be used for all other supported types of embedding. As of now, we have provided the dashboard ID as a mandatory valid property to generate the token. We will remove this dashboard ID mandatory requirement in an upcoming future release.

Key Considerations

  • Set the mode property to BoldBI.Mode.AIAssistant in your frontend configuration.
  • Call the loadAIAssistant() method to render the AI Assistant.

Steps to Embed the AI Assistant

  • Install the Bold BI Embedded SDK (via NPM or CDN).
  • Add a container <div> in your frontend where the AI Assistant will load.
  • Create a Bold BI instance with the required properties and call loadAIAssistant().
  <body onload="embedSample();">
    <div id="embed_container"></div>
    <script>
      function embedSample() {
        var boldbiEmbedInstance = BoldBI.create({
          serverUrl: "<Bold BI Server URL>",
          mode: BoldBI.Mode.AIAssistant,
          embedContainerId: "<Embed Container Id>", 
          embedToken: "<Embed token generated from backend server>"
        });
        boldbiEmbedInstance.loadAIAssistant();
      }
    </script>
  </body>

Supported Authentication

Note: For more information on AI Assistant members and methods, refer to this link