- 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.
Dashboard filters
Visibility
Filters are hidden by default on embedded dashboards. To show a filter, edit the filter and enable the “Show on public dashboard” option. This is configured per-filter, allowing you to choose exactly which filters viewers can interact with. For more information on configuring filters, see the filters and variables documentation.Secure filtering
Secure filtering allows you to lock filter values in public dashboard URLs using JWT tokens. This prevents viewers from modifying certain filter values, making it safe to share dashboards that filter data by tenant, user, or other sensitive parameters. When to use secure filtering When a filter is hidden (via “Show on public dashboard” disabled), the filter uses its default value and viewers cannot override it via URL parameters—those values are enforced server-side. Use secure filtering when you need to dynamically set different filter values for different viewers:- Multi-tenant applications: Lock a
company_idortenant_idfilter so each customer only sees their own data - User-specific dashboards: Lock a
user_idfilter to show personalized data - Sensitive data access: Ensure viewers cannot modify filters that control access to restricted information
- publicSharingLinkId: The ID from your public share link. When you enable sharing on a dashboard and copy the link, it looks like
https://charts.basedash.com/shared/abc123. Theabc123part is yourpublicSharingLinkId. - jwtToken: A signed JWT containing the locked filter values.
| Claim | Type | Required | Description |
|---|---|---|---|
dashboardLinkId | string | Yes | Must match the publicSharingLinkId in the URL |
params | object | Yes | Key-value pairs of filter syntax names to locked values |
exp | number | Yes | Expiration timestamp (Unix seconds) |
iat | number | No | Issued-at timestamp (Unix seconds) |
params object keys should match your filter’s syntax name (e.g., user_id, company_id). Values can be strings, numbers, booleans, or arrays of strings.
Example
Here’s an example JWT payload that locks a company_id filter:
- Locked filters are applied server-side and cannot be changed by viewers
- Locked filters are hidden from the filter bar on the dashboard
- Other filters (not included in the JWT) remain interactive if configured to show on public dashboards
- If the JWT is invalid, expired, or the signature doesn’t match, the dashboard returns an error
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
Step 1: Enable embedding
Enable embedding for your organization by going to Settings → Embedding → Enable full app embedding. You’ll also need your JWT secret to sign tokens that authenticate users into the embedded app. You can find this at Settings → Security. 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:Customization options
You can customize the appearance of the embedded app by appending query parameters to the SSO URL:| Parameter | Values | Default | Description |
|---|---|---|---|
theme | light, dark, auto | auto | Override the theme for the embedded app. auto uses the system preference. |
hide_org_name | true | false | Hide the organization name in the sidebar |
hide_suggested_prompts | true | false | Hide the suggested prompts in the AI chat input |
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 You can add specific origins (e.g.,https://app.example.com) or use wildcard patterns to allow all subdomains of a domain (e.g., https://*.example.com).
Wildcard patterns must include a full domain name. Overly broad patterns like
https://*.com are not allowed.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. You can add a specific origin (e.g., https://app.example.com) or use a wildcard pattern to allow all subdomains (e.g., https://*.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.Related pages
- API reference
- Filters and variables - Includes secure filtering for locking filter values on public dashboards
- Dashboards
- Chat