Dashboard > Embed Dashboard
Learn how to embed a Draxlr dashboard or a single dashboard element in your product with HTML, React or Vue, and how the backend API keeps your API secret safe.
Embed Dashboard puts a Draxlr dashboard inside your product. Your customers see its charts, tables and filters right in your app, styled to match it, without signing in to Draxlr.
You can embed a whole dashboard, or a single dashboard element such as one chart.
Single dashboard or full app?:
To give each customer their own analytics workspace, with their own saved queries and dashboards, a query editor and the AI assistant, use Full App Embed.

What your customers get
- The dashboard's elements, laid out as on your dashboard. The embed works on desktop and mobile.
- Dashboard filters with the default values you set. You can hide filters, or let customers change only the value.
- Drill downs: View Data, Group by and custom drill downs, for the elements you choose.
- Exports: PDF and Excel for the dashboard, and CSV for each element, if you allow them.
- Your look: your colors, fonts and custom CSS.
Customers can't edit the dashboard, its elements or its filters.
How it works
Configure the embed in Draxlr
Open the dashboard, click Embed, then click Configure dashboard embed. The embed builder shows a live preview and generates the code for your settings.
Generate an embed URL on your backend
When a signed-in user opens the page, your server calls the Generate Embed URL API with your API key and secret and your settings. Draxlr returns an embed URL that's valid for 24 hours.
Render the embed in your frontend
Add the snippet to your page and pass it the embed URL. The embed loads in an iframe.
<div
data-embedUrl="EMBED_URL_FROM_YOUR_BACKEND"
id="draxlr-YOUR_DASHBOARD_ID"
class="draxlr-embed"
data-id="YOUR_DASHBOARD_ID"
data-width="100%"
data-minHeight="600px"
data-maxHeight="2000px"
></div>
<script src="https://assets.draxlr.com/embed/embed-v2b.js"></script>
The embed grows to fit the dashboard, between data-minHeight and data-maxHeight. For React and Vue, use the react-draxlr-embed and vue-draxlr-embed packages. The builder generates the code for all three.
Backend API or frontend only
The embed builder offers two kinds of code. Use backend API is on by default.
| Backend API | Frontend only | |
|---|---|---|
| Embed URL | Your server requests it and passes it to the page | The snippet requests it from the browser each time the page loads |
| API key and secret | Stay on your server | Written into your page's HTML |
| Settings and filter values | Sent from your server | Visible in your page's HTML |
| Row-level security | Supported | Not supported |
Frontend-only code exposes your API secret:
Anyone who can open your page can read the API key and secret in its HTML and use them to request embed URLs. Use the backend API for customer-facing embeds, and keep the frontend-only code for internal pages.
Embed a single element
To embed one chart or table instead of the whole dashboard, open the element's menu (⋮) on the dashboard and choose Embed. The same builder opens for that element. See Embed Dashboard Element.
Plans and access
- Embedding is available on plans that include Embedding. On other plans, the Embed button is disabled.
- Members with Admin or Full access can open the embed builder.
- Row-level security needs a plan that includes it.
Things to know
- Embed URLs expire: they're valid for 24 hours. Generate a new one each time the page loads.
- Settings live in your code: the builder doesn't save filters, drill downs, exports or appearance. They're in the code you copy, so copy it again after you change them. Only Allowed domains is saved to the dashboard.
- Each customer's data: without row-level security, every customer sees all the rows the dashboard shows.