Overview
Embed scoped dashboards in your customers' apps via iframe, web component, or a hosted portal.
Embed lets your customers see their slice of a dashboard from inside your own product. Your backend signs a per-customer JWT; trend renders the dashboard with the customer’s attributes injected into your dataset SQL.
Note
Embed is a premium add-on tier. Enable it from Settings → Billing once you’ve subscribed. When enabled, an Embed section appears in the sidebar with Customers + API keys.
Three embed modes
| Mode | Best for | Where it lives |
|---|---|---|
| iframe | Server-rendered apps and drop-in HTML | An iframe tag pointing at app.trend.dev/embed/... |
| Web component | SPAs (React, Vue, Svelte) and anywhere you want live attribute swaps | A custom trend-dashboard element loaded from embed.js |
| Customer portal | Customers without an app to embed into | portal.trend.dev/[workspace]/[customer] |
The two-step flow
- Your backend mints a token by calling
POST /api/embed/tokenwith your workspace API key. The request body carries the customer’s external ID + their attributes. - Your frontend loads an iframe (or a
<trend-dashboard>web component) pointing at/embed/dashboards/[id]?token=<jwe>. trend renders the published dashboard, resolving{{trend.attributes.*}}references from the token.
No customer pre-registration step. Identity, attributes, and dashboard access all live in the signed token. Customers you’ve minted tokens for show up automatically in Embed → Customers as an audit trail.
How scoping works
- Which dashboards can be embedded? — Any dashboard where the workspace owner has toggled Embed on (Dashboards → ⋯ → Embed). One token works for any embed-enabled dashboard in the workspace.
- Which rows can each customer see? — Whatever your dataset SQL filters by using
{{trend.attributes.<key>}}references. trend hard-rejects a chart query if a referenced attribute isn’t in the token (no silent cross-customer leaks). - How is the workspace isolated from other embedders? — Every token is signed with a workspace-scoped key. A token signed for workspace A can never reach workspace B’s dashboards.
Warning
Filter every embed dataset by at least one customer-scoped attribute (usually company_id). trend won’t auto-inject — that’s by design — but it means a dataset without an attribute filter would expose every row to every customer. See Per-customer attributes for the exact pattern.
Pricing
Embed is a $7/mo per unique embed customer add-on. A customer counts once, forever — the count only ever grows unless you delete the customer row or toggle them to Demo (see below).
Demo customers are free
Every customer has a Demo toggle on the Registered Customers page. Demo customers:
- Don’t count toward billing. They’re excluded from the Stripe invoice.
- See a diagonal “DEMO” watermark across every chart when they view a dashboard. Same data flow (attribute filtering still runs), but the UI signals “not for real users.”
Use demo customers for:
- Sales demos to prospects — show them a live embed without incurring $7/mo per prospect
- Dev / QA / staging environments where test data shouldn’t inflate your bill
- Internal previews for stakeholder review
Toggle a customer to Demo any time via Embed → Customers → Registered → Edit → Demo customer. The Stripe quantity syncs automatically.
What to read next
- Per-customer attributes — the
{{trend.attributes.*}}pattern + safety semantics. - iframe mode — server-rendered integration in 5 minutes.
- Web component mode — the
<trend-dashboard>custom element for SPAs. - Customer portal — hosted portal.trend.dev surface with magic-link login.