Tell me how to start the SDK in my app.
Show me how to use the SDK
Prompting is an essential step when building embed code for ThoughtSpot integration or when exploring ThoughtSpot REST APIs using SpotterCode.
This guide provides prompting guidance and best practices to help you get the best results for a variety of use cases.
Provide clear, direct, and specific instructions. If you want a code sample as the output and nothing else, specify this in your prompt.
Avoid multiple task requests in a single prompt. Break down your questions and precisely explain what you want.
For precise results, use ThoughtSpot terminology, such as Liveboard, Spotter, visualization, and full application embedding.
To receive specific answers and narrow down your request, mention the SpotterCode skill in instructions. For example, ask How do I embed a ThoughtSpot page in my app? Use the available SpotterCode tools and skills to get this information.
Provide contextual information when asking a question and directing the AI model to perform an action. For example, describe the end goal of the task. If an action must be performed sequentially, use numbered lists or bullet points to ensure the AI agent completes the task as intended.
Review each response thoroughly. For best results, use the advanced AI models.
Do not include sensitive or confidential data in prompts.
Provide additional details and clarifications in the next prompt if you are not getting the desired response.
Do not rely on SpotterCode to infer business logic that isnโt explicitly defined in the documentation or the SDK.
For accurate and consistent responses, improve your prompts.
Refer to the prompt examples in the following table for ThoughtSpot embedding use cases:
| Vague prompt | Clear prompt |
|---|---|
How do I embed ThoughtSpot? | I want to embed full ThoughtSpot application in my app. Use the available tools to get this information and generate the embed code. |
I want to use ThoughtSpot in my app. | I want to embed a ThoughtSpot Liveboard in my React application. Use the available tools to get this information and generate the embed code. |
Show me how to use the SDK. | I want to embed ThoughtSpot Spotter Search and AI analytics in my application. Use the 'get-visual-embed-sdk-reference' and 'get-developer-docs-reference' tools to get the information and code samples. |
Give me code for embedding analytics. | Provide an example of embedding the full ThoughtSpot application using AppEmbed. |
How do I add Search? | How do I use the SearchEmbed component to embed a search page with a pre-selected data source? |
Tell me how to start the SDK in my app. Show me how to use the SDK | How do I initialize the ThoughtSpot Visual Embed SDK in a React application? |
What is the embed code for Liveboard? | Use the SpotterCode tools and generate the embed code for a Liveboard in a React application |
How do I add a chart in my app? | How do I embed a single chart or table from a ThoughtSpot Liveboard in my application? |
How do I use runtime filters? | Show a code example for embedding a Liveboard with two runtime filters: one for 'Region' set to 'Midwest' and one for 'item type' set to 'Jackets', using the Visual Embed SDK. |
Add an event hook to Liveboard. | Generate a React component that uses the ThoughtSpot embed SDK to display a Liveboard and add an event to trigger filter updates. |
Can I customize the embed? | Fetch the documentation for the LiveboardEmbed class and summarize the available customization options. |
How do I update my code? Update to new version | Update my embed code using the latest Visual Embed SDK version and highlight any breaking changes from the documentation. |
Show me an example with filters Add filters to my embed |
|
Give me code for embedding analytics | Provide a code snippet to embed Spotter and pass a search query string as a prop |
Change the Liveboard layout | Show how to customize the Liveboard breakpoint width and explain the impact. |
Add custom styles to buttons | Change the background color of the Call To Action (CTA) buttons in the embed view to Cerulean blue (#2A52BE). |
If using ThoughtSpot REST APIs in application workflows, consider using the examples listed in the following table:
| Vague prompt | Clear prompt |
|---|---|
How do I get the dashboards via API | How do I get a list of my Liveboards via ThoughtSpot REST API? |
Show me how to connect to the API Show me how to use the API | Show a cURL example for authenticating to ThoughtSpot REST API v2.0 using OAuth Generate a POST request to /api/rest/2.0/metadata/search, including required headers and body. |
How do I add a user using API? | How do I create a new user with admin privileges via REST API? Provide the endpoint, method, and sample payload. |
Get data from a chart via API | Generate a REST API request example to fetch data from a specific chart in a Liveboard. |
What do I need to include in my API request? | What headers are required for a REST API call to ThoughtSpot? List and explain each. |
How do I see new actions in my app? | How do get a list of custom actions added in my embed via REST API? |
This section lists the common error scenarios, root causes, and recommended actions for troubleshooting errors related to SpotterCode integration. If the error persists, contact ThoughtSpot Support for further assistance.
SpotterCode is not installed or enabled.
Incorrect MCP Server URL or errors in the MCP configuration file.
SpotterCode server is not reachable.
Ensure the SpotterCode is properly installed and enabled in your IDE.
Verify whether the SpotterCode MCP server is reachable. If the server is not reachable, contact ThoughtSpot Support.
Verify whether your organizationโs network/firewall settings are blocking communication.
Exit and restart your application and try connecting again.
Development environment non-AI-native or not AI-enabled.
If your IDE is not AI-native, try installing an extension, such as Copilot.
Check if your environment has access to AI models.
Start a chat session and specify the Agent to use SpotterCode skills. If the issue persists, contact your application administrator.
The prompt is complex, involves multiple actions, or includes a broader context, resulting in a longer search and processing time.
High server load or network latency can further delay the response.
Make your prompt as specific as possible. Specify the SDK version, the exact component, and the desired output. For best results, break down complex requests into smaller, sequential prompts. Refer to prompt examples and best practices for tips.
Try using a different AI model and review.
Reset the chat session and try it again.
The AI Agent is not using the right skills or the input schema of the MCP skills efficiently.
The prompt input is complex or ambiguous.
Check the response generation flow to see the query parameters used by the AI Agent in its MCP request.
Refine your query to be more specific. Refer to the best practices and Prompt examples recommended by ThoughtSpot.
Choose a different AI model and review the results.
SpotterCode used a different version for code generation.
No version was specified in the prompt.
SpotterCode uses the latest version of the SDK by default. If youโd like to use a different version, specify the version in your prompt.
Review API and SDK changelog in the documentation for feature deprecation and breaking changes.
SpotterCode couldnโt determine the SDK content for your application or client.
Although the AI Agent on your IDE is capable of finding relevant information for your project context, we recommend stating the client environment and required SDK client library clearly in the prompt.