Embedding is available to all Lightdash Cloud users and Enterprise On-Prem customers. Get in touch to have this feature enabled in your account.
Overview
Metrics catalog embedding lets you drop the Lightdash metrics catalog directly into your application. Embedded users can browse the metrics defined in a project, search by name or category, preview a metric on a small chart, and — if you allow it — jump into Explore to slice the metric by any dimension in the model. Metrics catalog embeds use the same JWT-based security model as other embed types, with a dedicatedcontent.type: "metricsCatalog" token. Dashboard, chart, and AI agent tokens cannot access the metrics catalog, and a metrics catalog token cannot render other embed surfaces.
When to use metrics catalog embedding
- Give customers a self-serve “what can I measure?” view of your semantic layer inside your product.
- Surface a metric browser next to your own charts so users can discover related metrics.
- Let embedded users start a new exploration from any metric without exposing your full Lightdash workspace.
Available features
Embedded metrics catalog supports:- Browsing all metrics in the project the JWT is scoped to
- Searching and filtering by category
- Previewing a metric with its default time-series chart
- Continuing into an embedded Explore from any metric when
content.canExploreistrue - Saving Explore results into a fixed destination space via write actions
- Row- and column-level filtering via user attributes
Prerequisites
Before you embed the metrics catalog, you need:- An embed secret for the project. See Embedding quickstart.
- At least one metric defined in the project’s semantic layer. See How to create metrics.
- A React or Next.js host application — metrics catalog embedding is only available through the React SDK.
- If you want embedded users to save charts from Explore, a destination space and a write actor. See Write actions.
Embed the metrics catalog with the React SDK
The React SDK ships aLightdash.MetricsCatalog component that renders the catalog inside an iframe. When the embedded viewer clicks Explore from here on a metric, the same component swaps in an embedded Explore view — the host page never has to change route.
Lightdash.MetricsCatalog for the full prop list and styling options.
Generate a metrics catalog embed token
Metrics catalog embeds require a JWT withcontent.type: "metricsCatalog". Generate it server-side using your embed secret.
content.type— must be"metricsCatalog".content.projectUuid— pins the embed to a specific project. The catalog only lists metrics from this project.
content.canExplore— whentrue, embedded users can click Explore from here on any metric to open the embedded Explore view. Omit or set tofalseto keep the embed read-only.writeActions— needed only whencanExploreistrueand you want embedded users to save charts they build from Explore. See Write actions.userAttributes— applies row- and column-level filters to catalog previews and Explore queries, identical to other embed types.user.email/user.externalId— surfaced in audit and analytics for the embedded viewer.
Controlling access
Metrics catalog embeds honor the same access controls as other embed surfaces:- The catalog only shows metrics from the project named in
content.projectUuid. - User attributes applied to the JWT hide metrics and dimensions whose
required_attributesrules the embedded viewer does not satisfy, both in the catalog listing and in any Explore session launched from it. - Metric previews and Explore queries run with the write actor’s permissions (when
writeActionsis set) plus anyuserAttributesfilters, so embedded viewers only see rows and columns they are entitled to. - When
canExploreis not set totrue, the catalog is read-only — the Explore from here action is hidden and Explore routes reject the token. - Metrics catalog tokens are rejected by dashboard, chart, AI agent, and data app routes, and vice versa.
Example: read-only metrics catalog
To publish a browse-only catalog without Explore or chart saving, mint a token with justtype and projectUuid:
Next steps
React SDK reference
Full prop reference for the Lightdash.MetricsCatalog component
Embedding reference
Complete JWT structure for metrics catalog embed tokens
Write actions
Configure the actor and destination space for embedded writes
User attributes
Implement row- and column-level security in embedded content