LLMs.txt: Complete documentation index for AI agents
AppEmbed

AppEmbed

Embeds full ThoughtSpot experience in a host application.

ConstructorsπŸ”—

new AppEmbed(domSelector: DOMSelector , viewConfig: AppViewConfig ) : AppEmbed

Function Parameters

domSelector
viewConfig

Returns

Defined in : embed/app.ts

Overrides V1Embed.constructor

MethodsπŸ”—

destroyπŸ”—

destroy() : void

Destroys the ThoughtSpot embed, and remove any nodes from the DOM.

Returns

void

Version : SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl

Defined in : embed/app.ts

Overrides V1Embed.destroy

getAnswerServiceπŸ”—

getAnswerService(vizId?: string ) : Promise< AnswerService >

Returns the answerService which can be used to make arbitrary graphql calls on top session.

Function Parameters

vizId

Optional

  • vizId: string

to get for a specific viz in case of a Liveboard.

Returns

Promise< AnswerService >

Version : SDK: 1.25.0 | ThoughtSpot: 9.10.0

Defined in : embed/ts-embed.ts

Inherited from V1Embed.getAnswerService

getCurrentContextπŸ”—

getCurrentContext() : Promise< ContextObject >

Context object for the embedded component.

Returns

Promise< ContextObject >

Version : SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl

const context = await embed.getCurrentContext();
console.log(context);

// Example output
{
  stack: [
    {
      name: 'Liveboard',
      type: ContextType.Liveboard,
      objectIds: {
        liveboardId: '123',
      },
    },
  ],
  currentContext: {
    name: 'Liveboard',
    type: ContextType.Liveboard,
    objectIds: {
      liveboardId: '123',
    },
  },
}

Defined in : embed/ts-embed.ts

Inherited from V1Embed.getCurrentContext

getIFrameSrcπŸ”—

getIFrameSrc() : string

Constructs the URL of the ThoughtSpot app page to be rendered.

Returns

string

Defined in : embed/app.ts

getIframeSrcπŸ”—

getIframeSrc() : string

Returns

string

Defined in : embed/ts-embed.ts

Inherited from V1Embed.getIframeSrc

getPreRenderIdsπŸ”—

getPreRenderIds() : {child?: string = …​, placeHolder?: string = …​, wrapper?: string = …​}

Retrieves unique HTML element IDs for PreRender-related elements. These IDs are constructed based on the provided 'preRenderId' from 'viewConfig'.

Returns

{child?: string = …​, placeHolder?: string = …​, wrapper?: string = …​}

property : {string} wrapper - The HTML element ID for the PreRender wrapper.

property : {string} child - The HTML element ID for the PreRender child.

Defined in : embed/ts-embed.ts

Inherited from V1Embed.getPreRenderIds

getThoughtSpotPostUrlParamsπŸ”—

getThoughtSpotPostUrlParams(additionalParams?: {[key: string ] : string | number} = {}) : string

Get the Post Url Params for THOUGHTSPOT from the current host app URL. THOUGHTSPOT URL params starts with a prefix "ts-"

Function Parameters

additionalParams
  • additionalParams: {[key: string ] : string | number} = {}

Index Signature Parameters

Returns

string

Version : SDK: 1.14.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw

Defined in : embed/ts-embed.ts

Inherited from V1Embed.getThoughtSpotPostUrlParams

getUnderlyingFrameElementπŸ”—

getUnderlyingFrameElement() : HTMLIFrameElement

Returns

HTMLIFrameElement

Defined in : embed/ts-embed.ts

Inherited from V1Embed.getUnderlyingFrameElement

hidePreRenderπŸ”—

hidePreRender() : void

Hides the PreRender component if it is available. If the component is not preRendered, it issues a warning.

Returns

void

Defined in : embed/ts-embed.ts

Inherited from V1Embed.hidePreRender

navigateToPageπŸ”—

navigateToPage(path: string | number , noReload?: boolean = false) : void

Navigate to particular page for app embed. eg:answers/pinboards/home This is used for embedding answers, pinboards, visualizations and full application only.

Function Parameters

path
  • path: string | number

string | number The string, set to iframe src and navigate to new page eg: appEmbed.navigateToPage('pinboards') When used with noReload (default: true) this can also be a number like 1/-1 to go forward/back.

noReload
  • noReload: boolean = false

boolean Trigger the navigation without reloading the page

Returns

void

Version : SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw

Defined in : embed/app.ts

offπŸ”—

off(messageType: EmbedEvent , callback: MessageCallback ) : TsEmbed

Removes an event listener for a particular event type.

Function Parameters

messageType

The message type

callback

The callback to remove

Returns

TsEmbed

const errorHandler = (data) => { console.error(data); };
tsEmbed.on(EmbedEvent.Error, errorHandler);
tsEmbed.off(EmbedEvent.Error, errorHandler);

Defined in : embed/ts-embed.ts

Inherited from V1Embed.off

onπŸ”—

on(messageType: EmbedEventT , callback: (payload: EmbedEventPayload< EmbedEventT > , responder?: (data: any ) : void ) : void , options?: MessageOptions = …​) : TsEmbed

Function Parameters

messageType
  • messageType: EmbedEventT

callback
  • callback: (payload: EmbedEventPayload< EmbedEventT > , responder?: (data: any ) : void ) : void

(payload: EmbedEventPayload< EmbedEventT > , responder?: (data: any ) : void ) : void

Function Parameters

payload
  • payload: EmbedEventPayload< EmbedEventT >

responder

Optional

  • responder: (data: any ) : void

(data: any ) : void

Function Parameters

data
  • data: any

Returns

void

Returns

void

options

Returns

TsEmbed

tsEmbed.on(EmbedEvent.Error, (data) => {
  console.error(data);
});
tsEmbed.on(EmbedEvent.Save, (data) => {
  console.log("Answer save clicked", data);
}, {
  start: true // This will trigger the callback on start of save
});

Defined in : embed/ts-embed.ts

Inherited from V1Embed.on

preRenderπŸ”—

preRender(showPreRenderByDefault?: boolean = false, replaceExistingPreRender?: boolean = false) : Promise< TsEmbed >

Creates the preRender shell

Function Parameters

showPreRenderByDefault
  • showPreRenderByDefault: boolean = false

Show the preRender after render, hidden by default

replaceExistingPreRender
  • replaceExistingPreRender: boolean = false

Returns

Promise< TsEmbed >

Defined in : embed/ts-embed.ts

Inherited from V1Embed.preRender

prerenderGenericπŸ”—

prerenderGeneric() : Promise< any >

Prerenders a generic instance of the TS component. This means without the path but with the flags already applied. This is useful for prerendering the component in the background.

Returns

Promise< any >

Version : SDK: 1.22.0

Defined in : embed/ts-embed.ts

Inherited from V1Embed.prerenderGeneric

renderπŸ”—

render() : Promise< AppEmbed >

Renders the embedded application pages in the ThoughtSpot app.

Returns

Promise< AppEmbed >

Defined in : embed/app.ts

Overrides V1Embed.render

showPreRenderπŸ”—

showPreRender() : Promise< TsEmbed >

Displays the pre-rendered component inside the host element. If the component has not been pre-rendered yet, it initiates rendering first. Inserts a placeholder element into the host and positions the pre-render wrapper to overlay it.

Returns

Promise< TsEmbed >

Defined in : embed/ts-embed.ts

Inherited from V1Embed.showPreRender

subscribedEventπŸ”—

subscribedEvent(eventName: HostEvent | Action ) : string

Generates the event name for a "Subscribed" embed event.

This helper appends the "Subscribed" suffix to a given host or action event, allowing you to listen for subscription lifecycle events in a consistent format.

Function Parameters

eventName

The host or action event to generate the subscribed event name for.

Returns

string

Version : SDK: 1.47.2 | ThoughtSpot: 26.3.0.cl

Defined in : embed/ts-embed.ts

Inherited from V1Embed.subscribedEvent

syncPreRenderStyleπŸ”—

syncPreRenderStyle() : void

Synchronizes the style properties of the PreRender component with the embedding element. This function adjusts the position, width, and height of the PreRender component to match the dimensions and position of the embedding element.

Returns

void

throws : {Error} Throws an error if the embedding element (passed as domSelector) is not defined or not found.

Defined in : embed/ts-embed.ts

Inherited from V1Embed.syncPreRenderStyle

triggerπŸ”—

trigger(messageType: HostEventT , data?: TriggerData< HostEventT > = …​, context?: ContextT ) : Promise< TriggerResponse< PayloadT, HostEventT, ContextT > >

Triggers an event to the embedded app

Payload typing: from SDK 1.52.0 (ThoughtSpot Cloud 26.9.0.cl), unknown fields on a known event’s payload fail to compile. From SDK 1.54.0 (26.11.0.cl) the payload is checked strictly against the event contract β€” update call sites now.

Function Parameters

messageType
  • messageType: HostEventT

The event type

data

The payload, typed against the event’s contract

context

Optional

  • context: ContextT

Optional context type to specify the context from which the event is triggered. Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context, ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context. Available from SDK version 1.45.2 | ThoughtSpot: 26.3.0.cl

Returns

Promise< TriggerResponse< PayloadT, HostEventT, ContextT > >

Version : SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)

// Trigger Pin event with context (SDK: 1.45.2+)
import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
embed.trigger(HostEvent.Pin, {
  vizId: "123",
  liveboardId: "456"
}, ContextType.Search);

Defined in : embed/ts-embed.ts

Inherited from V1Embed.trigger

triggerUIPassThroughπŸ”—

triggerUIPassThrough(apiName: UIPassthroughEventT , parameters: UIPassthroughRequest< UIPassthroughEventT > ) : Promise< UIPassthroughArrayResponse< UIPassthroughEventT > >

Triggers an event to the embedded app, skipping the UI flow.

Function Parameters

apiName
  • apiName: UIPassthroughEventT

The name of the API to be triggered.

parameters

The parameters to be passed to the API.

Returns

Promise< UIPassthroughArrayResponse< UIPassthroughEventT > >

Defined in : embed/ts-embed.ts

Inherited from V1Embed.triggerUIPassThrough

Β© 2026 ThoughtSpot Inc. All Rights Reserved.