This repository contains multiple examples of using ThoughtSpot Custom Actions. A custom action is a type of extension that can be added to ThoughtSpot searches, answers and liveboards to give users additional capabilities. For example, an inventory manager might search ThoughtSpot for items that are low in stock and push a reorder directly from ThoughtSpot to their inventory system.
This is a react.js application. See the src/examples folder for specific examples.
import { init, AuthType, EmbedEvent, LiveboardEmbed } from "@thoughtspot/visual-embed-sdk";
init({
thoughtSpotHost: "https://your-instance.thoughtspot.cloud",
authType: AuthType.Basic,
username: "your-username",
password: "your-password",
});
const embed = new LiveboardEmbed(document.getElementById("ts-embed"), {
liveboardId: "your-liveboard-id",
});
// Listen for custom action callbacks
embed.on(EmbedEvent.CustomAction, (payload) => {
const { id, data } = payload.data;
if (id === "show-details") {
console.log("Custom action triggered with data:", data);
// Handle your custom action here
}
});
embed.render();Open in CodeSandbox
- Custom Actions on ThoughtSpot Developer Docs.
$ git clone https://github.com/thoughtspot/developer-examples
$ cd visual-embed/custom-actions
$ npm i
$ npm run dev