Skip to content

[SCAL-349233] Add DataAppEmbed and enableDataApps - #734

Open
akshay-pandey-thoughtspot wants to merge 3 commits into
thoughtspot:mainfrom
akshay-pandey-thoughtspot:SCAL-349233-data-app-embed
Open

akshay-pandey-thoughtspot wants to merge 3 commits into
thoughtspot:mainfrom
akshay-pandey-thoughtspot:SCAL-349233-data-app-embed

Conversation

@akshay-pandey-thoughtspot

Copy link
Copy Markdown

Summary

Two additions for showing ThoughtSpot Apps in an embed:

  • DataAppEmbed embeds a single App by id, the way LiveboardEmbed embeds one Liveboard. It loads the App embed route on the v2 shell, /v2/?…#/embed/insights/apps/<dataAppId>.
  • enableDataApps, a new view config on AppEmbed and DataAppEmbed, off by default. Embedded ThoughtSpot shows Apps only when the host sets it to true and the instance has Apps turned on.

The ThoughtSpot side is dev/scaligent#74710, which is internal. It adds the route and reads the flag.

This is a first skeleton, there to get a build to test against. Follow-ups are listed below.

const embed = new DataAppEmbed('#tsEmbed', {
  dataAppId: '<app-id>',
  enableDataApps: true,
  frameParams: { height: '800px' },
});
embed.render();

// Apps inside the full app
new AppEmbed('#tsEmbed', { enableDataApps: true, path: 'insights/home/apps' }).render();

Changes

  • src/embed/data-app.ts: DataAppEmbed (extends TsEmbed) and DataAppEmbedViewConfig.
    • dataAppId is required. Without it, render() raises a VALIDATION_ERROR with the new EmbedErrorCodes.DATA_APP_ID_MISSING and renders no frame.
    • fullHeight isn't supported. A JS caller that passes it gets a warning, and the option is dropped.
    • embedComponentType: 'dataApp'.
  • enableDataApps:
    • added to AppViewConfig and DataAppEmbedViewConfig, and sent as the new Param.EnableDataApps URL param;
    • added to BOOTSTRAP_URL_PARAMS, so it stays on the URL under excludeConfigFromURL. The app reads it at boot for its route guards, before APP_INIT arrives.
    • Without it, DataAppEmbed shows a not-available message in the frame, and AppEmbed keeps Apps hidden as today.
  • React: <DataAppEmbed> via componentFactory, exported from /react together with DataAppEmbedViewConfig.
  • The @version tags read SDK: <TBD> | ThoughtSpot Cloud: 26.12.0.cl. The ThoughtSpot release still needs confirming: it is the one that ships the App embed route.

Testing

  • Unit tests for the first commit. The new data-app.spec.ts covers the URL, id encoding, the missing-id error and fullHeight. The full test-sdk suite passed (55 suites, 2,231 tests), and so did the React export parity spec.
  • Unit tests for the enableDataApps commit: data-app.spec.ts (both values, and excludeConfigFromURL) and app.spec.ts. These have not been run locally; this PR's CI runs them.
  • On the first commit, lint on the changed files, tsc --noEmit, check-size (32.78 kB of 34 kB) and lint-versions all passed.
  • Manual, against a dev cluster running #74710's build, with cookie auth. The embed app used a local build of this branch, framed cross-site from localhost and from a CodeSandbox Devbox:
    • DataAppEmbed with enableDataApps: true renders the App;
    • without the flag, it shows the not-available state;
    • AppEmbed at insights/home/apps shows the Apps list with the flag, and ThoughtSpot Home without it.
  • Re-test with this PR's pkg.pr.new build.

Follow-ups (not in this PR)

  • An Error event while enableDataApps is off, and codes for not entitled, not found and nothing published.
  • Action values for the App's buttons.
  • An AppLoad event.
  • Runtime filters.
  • Docs page.

🤖 Generated with Claude Code

DataAppEmbed embeds a single ThoughtSpot App, the way LiveboardEmbed
embeds one Liveboard. It loads the App embed route on the v2 shell,
/v2/?...#/embed/insights/apps/<dataAppId>, which renders the App page
inside ThoughtSpot.

- dataAppId is required: without it, a DATA_APP_ID_MISSING
  validation error and no frame
- fullHeight is not supported: it is dropped with a warning
- React <DataAppEmbed> wrapper and type exports
- embedComponentType 'dataApp'

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Embedded ThoughtSpot hides Apps unless the host opts in. The new
enableDataApps view config sends enableDataApps on the iframe URL; the
app shows Apps only when it is true and the instance has Apps on.

- AppViewConfig and DataAppEmbedViewConfig take enableDataApps
  (default false); DataAppEmbed now sends its own embed params
- Keep the param on the URL under excludeConfigFromURL, since the app
  reads it at boot for its route guards
- Specs for both embed types and the excludeConfigFromURL case

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akshay-pandey-thoughtspot
akshay-pandey-thoughtspot requested a review from a team as a code owner November 4, 2026 06:53

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the DataAppEmbed component and its React wrapper to support embedding a single ThoughtSpot App by its ID, alongside adding the enableDataApps configuration flag to both AppEmbed and DataAppEmbed. The review feedback identifies a critical bug in DataAppEmbed where declaring viewConfig as a constructor parameter property overwrites the base class initialization. It also recommends performing dataAppId validation before calling super.render() to prevent unintended side effects, and highlights a style guide violation in the React component's JSDoc example where the function name should match the component name.

Comment thread src/embed/data-app.ts Resolved
Comment thread src/embed/data-app.ts Resolved
Comment thread src/react/index.tsx Resolved
@pkg-pr-new

pkg-pr-new Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@thoughtspot/visual-embed-sdk@734

commit: 6af866e

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant