- Dashboard embedding: Embed a dashboard as a read-only, interactive view in an iframe.
- Full app embedding: Embed the full Basedash app (dashboards + chat) inside your product with JWT SSO.
Dashboard embedding
Dashboard embedding is best when you want to show a specific dashboard inside another app.Create an embed
- Open the dashboard in Basedash
- Click Share in the dashboard header
- Enable the Embedding toggle
- Copy the iframe snippet (or copy the plain URL)
/shared/{id} path.
Show or hide dashboard filters
In the share dialog, you can configure whether dashboard filters are visible in the embed. This is useful when you want a clean, fixed view (hidden filters) versus an explorable view (shown filters).Full app embedding
Full app embedding lets you embed the entire Basedash experience inside your product. Your users can view dashboards, build new charts, and chat with the AI assistant—all without leaving your application. This is ideal for customer portals, partner dashboards, or any scenario where you want to give users a complete BI experience powered by their own data.How it works
Full app embedding uses JWT-based single sign-on (SSO) inside an iframe:- Your server generates a JWT containing the user’s identity and your Basedash organization ID
- The iframe loads the SSO endpoint (
/api/sso/jwt?jwt=...) with the token - Basedash validates the JWT against your organization’s secret
- A session is created for the user (creating their account if needed)
- The user is redirected to your organization’s home page inside the iframe
Setup overview
Setting up full app embedding involves these steps:- Enable embedding and get your JWT secret
- Generate JWTs server-side for your users
- Load the iframe with the SSO URL
Full app embedding requires API access. Contact [email protected] to enable the public API for your account.
Step 1: Enable embedding
Enable embedding for your organization by going to Settings → Embedding → Enable full app embedding. Once enabled, you can copy your JWT secret from this page. The JWT secret is used to sign tokens that authenticate users into the embedded app. You can also configure allowed origins on this page to restrict which domains can embed your organization.Step 2: Generate JWTs server-side
Your backend must generate a signed JWT for each user who accesses the embed. Here are examples in common languages:Step 3: Load the iframe
In your frontend, render an iframe pointing to the SSO URL:JWT claims reference
Your JWT must include these claims:| Claim | Type | Required | Description |
|---|---|---|---|
email | string | Yes | The user’s email address |
orgId | string | Yes | Your Basedash organization ID |
exp | number | Yes | Expiration timestamp (Unix seconds) |
iat | number | Yes | Issued-at timestamp (Unix seconds) |
firstName | string | No | User’s first name |
lastName | string | No | User’s last name |
role | string | No | ADMIN or MEMBER (defaults to MEMBER) |
The
role claim is only used when creating new members. It doesn’t change the role of existing members.Allowed origins
For security, you can restrict which domains can embed your Basedash organization. Configure this at Settings → Embedding If no origins are configured, embeds are allowed from any domain.Security best practices
Keep your JWT secret secure
Keep your JWT secret secure
Never expose the
jwtSecret in client-side code. Generate JWTs only on your backend.Use short token expiration
Use short token expiration
JWTs should expire within 10-60 minutes. Users only need a valid token when loading the iframe—once authenticated, they use a Basedash session cookie.
Configure allowed origins
Configure allowed origins
Always set
embedAllowedOrigins in production to prevent unauthorized sites from embedding your organization.Use read-only database credentials
Use read-only database credentials
When connecting data sources, use database credentials with read-only permissions to minimize risk.
Validate user access server-side
Validate user access server-side
Before generating a JWT, verify that the current user should have access to the embedded analytics.
Troubleshooting
Missing JWT parameter
Missing JWT parameter
Error: “The embed URL is missing the required JWT token”Make sure your iframe
src includes the ?jwt= query parameter with your signed token.Embedding not enabled
Embedding not enabled
Error: “Embedding is not enabled for this organization”Enable embedding when creating the organization by setting
fullEmbedEnabled: true, or update an existing organization via the API.Origin not allowed
Origin not allowed
Error: “This embed is not authorized to load from [origin]”Add your domain to the
embedAllowedOrigins array. Make sure to include the full origin (e.g., https://app.example.com).Authentication failed (invalid or expired JWT)
Authentication failed (invalid or expired JWT)
Error: “The JWT token is invalid or has expired”
- Verify you’re using the correct
jwtSecretfor the organization - Check that the JWT hasn’t expired (tokens should be short-lived)
- Ensure you’re signing with the HS256 algorithm
- Verify the clock on your server is accurate (JWT validation allows 30 seconds of clock skew)
Missing Referer header
Missing Referer header
Error: “Unable to verify the request origin”This happens when allowed origins are configured but the browser doesn’t send a Referer header. Check that:
- Your page doesn’t have
Referrer-Policy: no-referrer - You’re not loading the iframe from a
file://URL during development
Organization not found
Organization not found
Error: “The organization ID in your JWT does not match any Basedash organization”Verify that the
orgId claim in your JWT matches an existing Basedash organization ID.