Multi-Tenancy Support
DataBrain supports embedding for different levels of tenancy based on how your client data is organized. Whether you separate data at the table level (rows identified by a client ID), schema level, database level, or across multiple datasources, DataBrain can handle your tenancy model. Common tenancy models include:- Single Table Tenancy: All client data in one table, separated by a
client_idcolumn - Multi-Level Tenancy: Combining multiple layers (e.g., schema + table, database + schema)
We’ve got you covered with a step-by-step guide here to help you integrate DataBrain dashboards into your user interface seamlessly.
Step-by-Step Guide to Embed DataBrain Dashboard
1
Install DataBrain NPM Package
2
Import the Plugin
3
Use the Components in Your Application
For embedding a DashboardorFor embedding a Metric CardFinding Your IDsSelf-hosted DataBrain:Request Headers:Minimum Request Body:The API will return a token that you pass to your frontend. The token can include additional parameters like
- Dashboard ID: In your Data App, navigate to Embed Info > Add New Embed. Select workspace name, choose embed type as dashboard, and select the dashboard. The Embed ID displayed is your dashboard ID. See detailed guide here.
- Metric ID: In your Data App, go to Embed Info > Add New Embed. Provide the workspace name, select embed type as metric, choose the dashboard containing your metric, then select the metric. The Embed ID shown is your metric ID. See detailed guide here.
token should be a guest token generated from your backend using DataBrain’s REST API. Each guest token is unique and ensures secure access control.Generating a Guest Token:Make a POST request from your backend to generate the guest token:Cloud DataBrain:appFilters, dashboardAppFilters, and permissions for fine-grained control. If expiryTime is not specified, the token won’t expire.Learn more about token generation and advanced options here.Example for Embedding Dashboard:Here is an example with a sample token and dashboardId that you can use in your frontend app to get started without a backend:Additional Resources and Customization
- Customizing the Look and Feel:
- For further customizations related to the appearance of the embedded elements, refer here.
- Understanding the Overall Architecture:
- For a comprehensive understanding of the overarching architecture and how embedding fits into it, refer here.

