Category / Section
How to Enable AI assistant in Token Based Iframe Embedding?
Published:
When embedding dashboards using Bold BI with an Iframe and token-based authentication, you may encounter issues with the visibility of the AI assistant icon. This article provides guidance on how to enable the AI assistant in your embedded dashboards.
Steps to Enable the AI Assistant
-
Understand the Syntax:
- For iframe embedding, the correct syntax to enable the AI assistant is
enable_ai_assistant
. This parameter is set tofalse
by default.
- For iframe embedding, the correct syntax to enable the AI assistant is
-
Modify the Embed URL:
- To enable the AI assistant, append the query parameter
enable_ai_assistant
to your embed URL and set to true,enable_ai_assistant=true
. Below is an example of how to form the embed URL with the necessary parameters, including enabling the AI assistant:
Example Code:
static void Main(string[] args) { // Variable declaration to form the embed URL var dashboardUrl = "https://analytics.lincros.com/bi/site/tracking/dashboards/e83b3f89-fd39-449b-9b31-08608a46da02/TMS%20-%20Painel%20Inicial/Painel%20Inicial?"; // Mandatory Parameters to embed the dashboard with token based authentication. var nonce = Guid.NewGuid().ToString(); var userEmail = "analytics@lincros.com"; double timeStamp = Math.Round((DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds); string embedSecretKey = "S5ipVXzGdkM7xuG5W1UqCe9cc8Lhctsa42vnCUmbLj0="; // Form the embed parameters string embedParameters = "embed_nonce=" + nonce + "&embed_user_email=" + userEmail + "&enable_ai_assistant=true"; string signature = SignURL(embedParameters, embedSecretKey); string embedSignature = embedParameters + "&embed_signature=" + signature; var embedUrl = dashboardUrl + embedSignature; var iframe = "<iframe src='" + embedUrl + "' id='dashboard-frame' width='100%' height='100%' allowfullscreen frameborder='0'></iframe>"; var filePath = System.AppDomain.CurrentDomain.BaseDirectory + "embed.html"; File.WriteAllText(filePath, iframe); string url = filePath; Process.Start("chrome.exe", url); }
- After implementing the above changes, test the embedded dashboard to ensure that the AI assistant icon is now visible.
- To enable the AI assistant, append the query parameter
By following these steps, you should be able to successfully enable the AI assistant in your embedded dashboards. If you have any questions or further clarification you can contact support team by creating ticket.