Available on the Enterprise plan. The React SDK is built on embedding.
@basedash/embed SDK is the recommended way to embed Basedash in a React application. It wraps the existing iframe integration with typed components and provides server-only helpers for creating authentication tokens.
Use the SDK to embed:
- AI chat
- The interactive dashboards workspace
- Insights
- Automations
- Models
- The full Basedash app with selected features
- A read-only shared dashboard
Install the SDK
Before you start
- Go to Settings → Embedding and enable full app embedding.
- Add your application’s production origins to the allowed origins list.
- Copy your JWT secret from Settings → Security.
- Store the secret in your server environment. Never expose it to browser code or a public environment variable.
fullEmbedEnabled: true and store the returned organization ID and JWT secret on your server.
Create a token endpoint
Your backend must authenticate the current user, confirm that they can access the customer organization, and create a short-lived Basedash token.createEmbedToken signs an HS256 JWT and defaults to a 10-minute expiration. The token identifies the user and organization. Basedash creates the user and organization membership on their first authenticated embed load.
Add the provider
In your React application, fetch the token from your backend and pass the callback toBasedashProvider.
token directly to an individual component without a provider.
Choose a component
Chat
BasedashChat shows AI chat and hides the other primary Basedash features. It hides the organization name by default.
Dashboards
BasedashDashboards shows the interactive dashboards workspace, including dashboard and chart creation, and hides the other primary features.
dashboardId to open a specific dashboard. Add hideSidebar when your application provides its own navigation:
Insights
BasedashInsights shows insights and hides the other primary features.
Automations
BasedashAutomations shows automations and hides the other primary features.
Models
BasedashModels shows models and hides the other primary features.
Full app
BasedashApp shows the complete embed by default. Use props to select which features remain available.
theme:light,dark, orautohideOrgNamehideChathideDashboardshideInsightshideAutomationshideModelshideSuggestedPromptshideSidebarinitialPage: the page to open, such as{ type: "dashboard", id: dashboardId }
Shared dashboard
BasedashSharedDashboard renders a read-only dashboard from a public sharing link. It does not require a provider or user token.
/shared/{id} URL.
Open a specific page
Each feature component accepts an ID prop that opens that item instead of the feature’s home page. ID props require@basedash/embed 0.3.0 or later.
BasedashApp, pass initialPage instead:
fetchToken provider, the component fetches a fresh token first, because the original may have expired, and keeps showing the current page until it arrives. If you pass token yourself, make sure it is still valid when the ID changes.
Hide the sidebar
hideSidebar removes the embed sidebar entirely, including the button, keyboard shortcut, and command menu entry that would reopen it. Every authenticated component accepts it in @basedash/embed 0.3.0 or later. It defaults to false.
Pair it with a single feature component and an ID prop when your application owns navigation, for example a page per dashboard:
Lock shared dashboard filters
For customer-specific or user-specific shared dashboards, create a secure filter token on your server.Customize the frame
All components accept:classNameandstylefor the outer containeriframePropsfor the underlying iframeloadingFallback, shown until the iframe loadserrorFallback, shown if token fetching failstitlefor the iframe’s accessible nameinstanceUrlfor self-hosted Basedash
allow="clipboard-write", and eager loading.
Handle token errors
UseerrorFallback to keep an authentication failure inside your page layout:
useBasedash() hook exposes the current token, status, error, and a refreshToken() method for custom controls.
Self-hosted Basedash
SetinstanceUrl on the provider:
Non-React applications
For Vue, Svelte, server-rendered HTML, or other applications, use the raw iframe integration. The framework-independentbuildEmbedUrl helper is also available from @basedash/embed if your project uses JavaScript or TypeScript without React.
Current limitations
- SDK components render Basedash through iframes; they do not render Basedash UI natively.
- Auto-resizing, navigation callbacks, and host-triggered actions are not available because Basedash does not currently expose an iframe messaging API.
- Shared dashboards are supported, but Basedash does not currently expose standalone shared-chart embeds.