Signed embedding
Signed embedding is available on Premium and Enterprise plans.
- Embedding analytics in your SaaS application for customers
- White-label analytics solutions
- Multi-tenant applications where each customer sees their own data
- Public-facing dashboards with controlled access
Getting started
Signed embedding works through a two-step authentication flow:- Generate a session – Your backend generates a temporary session using the Cube API
- Exchange for a token – The iframe automatically exchanges the session for a long-lived access token
- Sessions are valid for 5 minutes and must be exchanged within this window
- Tokens are valid for 24 hours after exchange
- Sessions are single-use and expire after being exchanged
Get your API key
To use the embedded chat or dashboard, you need an API key:- Go to Access → API Keys in your Cube admin panel
- Generate or copy your existing API key.
- You’ll use this key to authenticate API calls for generating embed sessions.
Generate an embed session
Use the Generate Session API to create a session for your user. This endpoint will automatically create (insert) or update the external user based on theexternalId provided.
Example (JavaScript)
Embedding via iframe
Use the session ID to embed the chat UI or the dashboard UI in your application:Complete example
Here’s a complete HTML example that demonstrates the full flow for embedding a dashboard:Pre-setting dashboard filters via URL
You can pre-set dashboard filter values by adding URL parameters in the format?f_<semantic_view>.<dimension>=<JSON>. The <semantic_view> and <dimension>
must match the internal names (not display titles) of the semantic view and
dimension configured on the filter widget. If the filter type is omitted, it
defaults to equals.
Example:
Customize dashboard style
You can customize the appearance of your dashboard — including background, widget styling, borders, titles, and fonts — using the Styling pane in the Dashboard Builder. Open your dashboard, click Dashboard Builder in the top bar, then click the gear icon to open the Styling panel.User attributes
User attributes enable row-level security and personalized chat responses by filtering data based on user permissions. The attributes you pass during session generation automatically filter data queries and responses.User attributes must first be configured in your Cube admin panel. See the
User Attributes documentation for
setup instructions.
- Configure attributes in your admin panel (e.g.,
city,department) - Pass attributes during session generation
- Data is automatically filtered based on user permissions through access policies
- AI responses are personalized to the user’s context
- Sales reps only see data for their assigned territory
- Regional managers see data filtered by their city
- Department heads see only their department’s metrics
Example application
For a complete working example of signed embedding, check out the cube-embedding-demo repository. This demo application provides:- A full working example of iframe embedding
- Implementation of signed iframe embedding with session generation
- A React-based UI for testing embedding functionality
- Backend server that securely handles API key authentication