Embedding Setup
Developer Docs
Embed Databrain dashboards and metrics in your app, so each customer sees only their own data. Add one web component and one backend call to get started.
Add a Databrain dashboard to your product with one web component and one backend call.
<dbn-dashboard token="GUEST_TOKEN_FROM_YOUR_BACKEND" dashboard-id="revenue-overview"></dbn-dashboard>Start here
Embed your first dashboard
Data app, API token, guest token and element, end to end.
Create a guest tokenThe backend call, what clientId means, and every error.
React, Next.js, Vue, Angular, Svelte, Solid and plain JavaScript.
Check your embed before go-liveTenancy, domains, expiry and a two-customer test.
What you need
| Item | What it is | Where to get it |
|---|---|---|
| Data app | Holds your embeds, API tokens and allowed domains | Data Studio > Data Apps |
| API token | Secret your backend uses to create guest tokens | The data app’s API tokens tab |
| Guest token | Short-lived token for one browser session and one customer | Your backend, from POST /api/v2/guest-token/create |
| Dashboard ID or metric ID | Says what to show | The embed’s Get snippet |
@databrainhq/ | The <dbn-dashboard> and <dbn-metric> web components | npm install @databrainhq/plugin |
Embedding needs the Enterprise plan, or Databrain must turn it on for your company.
Go further
- Change what users can do: component options and
options. - Match your brand: theme and appearance.
- Filter per customer: metric app filter and dashboard app filter.
- React to clicks and events: server events and embed functions.
- Let AI agents work with Databrain: MCP server.