How to Embed a Databricks Dashboard in Your App

Embed a Databricks dashboard in your app using a SQL warehouse, a personal access token and row-level security. Covers setup, access rules and HTML, React and Vue code.

Vivek, Founder of DraxlrVivek7 min read
How to Embed a Databricks Dashboard in Your App

Your customers already see the numbers they care about in your product. Usage, spend, delivery times, error rates. If those numbers live in Databricks, the next step is putting a live dashboard inside your app so customers don't have to ask your team for an export.

This guide shows how to embed a Databricks dashboard in your app with Draxlr. You'll connect a Databricks SQL warehouse, build the dashboard once, set row-level security so each customer sees only their own rows, and paste the embed code into your product.


What you need before you start

  • A Databricks workspace with a SQL warehouse that can read the tables you want to chart
  • A personal access token from a user who can read those tables
  • A Draxlr account on a plan that includes embedding. Row-level security for embeds is included on the Power plan and above.
  • A column in your data that identifies the customer, such as account_id or tenant_id

How embedding a Databricks dashboard works

The workflow has five steps:

  1. Connect your Databricks SQL warehouse to Draxlr
  2. Build the dashboard against your Delta tables
  3. Set row-level security so each customer's token limits the rows they can see
  4. Configure the look of the embed
  5. Paste the embed code into your app

Your data stays in Databricks. Draxlr sends queries to your SQL warehouse and renders the results. Your app only loads the dashboard and passes along a signed token for the signed-in customer.


Step 1: Connect your Databricks SQL warehouse

Draxlr connects to a Databricks SQL warehouse, not to a cluster or notebook. You need three values:

  1. Server hostname. Open SQL Warehouses in your Databricks workspace, pick the warehouse, and copy the server hostname from its connection details.
  2. HTTP path. Copy it from the same connection details page.
  3. Personal access token. Generate one from your Databricks user settings under access tokens. Set an expiry date you can manage, and rotate the token before it lapses.

In Draxlr, add a new database, choose Databricks, and paste the hostname, HTTP path and token. Then pick the catalog and schema you want to work in. Draxlr reads the schema so your tables appear in the query builder.

If you're not sure which warehouse to use, pick the one your analysts already use for reports. A dedicated warehouse for embedded dashboards is easier to size and monitor, though, so you can see the embed load separately from internal work.


Step 2: Build the dashboard

Draxlr gives you three ways to build the queries behind each chart:

  • Visual query builder for picking tables, columns, filters and aggregations without writing SQL
  • AI SQL for describing a question in plain English and getting a query you can review
  • Raw SQL when you want full control over joins, CTEs and Databricks-specific functions

You can mix all three in one dashboard. Add charts, tables and metrics, arrange them on the page, and save. Every item runs against your live Delta tables when a viewer opens the dashboard.

Keep the dashboard small at first. Five to eight items cover most customer-facing use cases. Each item sends a query to the warehouse, so a dashboard with twenty heavy queries will use more compute every time it loads.


Step 3: Set row-level security for each customer

This is the step that makes the dashboard safe to show outside your company. Draxlr handles it with row-level security (RLS), set up in three pieces:

  • A permission chooses which Databricks tables the embed can use and adds a row rule to each one. For example, account_id equals the accountId attribute.
  • An RLS group attaches that permission. One permission can back several groups.
  • The embed token names the group and carries the signed-in customer's attribute values. Your backend sends them when it requests the token, for example "rlsGroup": "Customers" and "attributes": { "accountId": 42 }.

Draxlr applies the group's rules with those values to every query behind the embed, including filters, drill-downs and exports. Because the values come from a token your server requests with your API secret, a customer can't change them in the browser to see another account's rows. Tables the permission doesn't allow are not available at all.

Test this before you ship. Request a token for one test account, open the dashboard, and confirm that every chart shows only that account's rows. Then repeat with a second account.


Step 4: Configure the embed

Open the embed settings to match the dashboard to your product. You can:

  • Turn export buttons on or off
  • Show or hide the header
  • Set the background color. Draxlr uses the background color to choose the light or dark theme, so the text and chart labels adjust with it. Use a six-digit hex value such as #1a1a2e. Three-digit hex values can trigger the dark theme on a light background.
  • Add a font and custom CSS for finer control

Settings in the embed token take priority over settings in the URL. If you need a light theme and a dark theme in the same app, generate two embed URLs and switch between them.

Draxlr single dashboard embed preview with KPI, line, bar and table items, next to the Embed Settings panel and the generated embed code


Step 5: Add the embed code to your app

Draxlr gives you three ways to add the dashboard:

  • HTML: a div with the embed URL and one script tag
  • React: a component that takes the embed URL as a prop
  • Vue: a component with the same props

For customer-facing dashboards, use backend API mode. Your server requests the embed token from Draxlr, adds the customer's RLS group and attribute values, and returns the URL to the browser. The API secret stays on your server.

Here's the HTML version of a backend-generated embed:

<div class="draxlr-embed" data-embedurl="https://your-server.example.com/api/analytics-embed"></div>
<script src="https://assets.draxlr.com/embed/embed-v2b.js"></script>

Your server endpoint returns the signed embed URL for the current customer. Your frontend never handles the secret.

If you use the React or Vue SDK, pass the same URL as the embedUrl prop. The SDK reloads the dashboard whenever that prop changes, so you can point it at a new customer's URL without remounting the page.


What to check before launch

  • Row isolation. Two test accounts see different rows on every chart, including after filters and drill-downs.
  • Table access. A customer's token can't reach tables outside the permission.
  • Warehouse cost. Your SQL warehouse auto-stop setting covers the time between loads, and the query count per dashboard is reasonable.
  • Token expiry. Your Databricks token and your backend token flow both have an expiry plan.
  • Theme. The dashboard looks right in light and dark mode, and the background color is six-digit hex.

Common use cases

Teams usually embed Databricks dashboards for:

  • Customer usage and billing views in a SaaS product
  • Client reporting portals for agencies and service providers
  • Partner dashboards that show each partner's own sales or activity
  • Internal tools that need the lakehouse data without a full BI login

Each viewer sees only the rows their token allows.


Conclusion

Embedding a Databricks dashboard lets your customers see live lakehouse data inside your product. You connect a SQL warehouse, build the dashboard once, set row-level security with a signed token, and paste the embed code. Your data stays in Databricks, and updates to the dashboard don't need a new release of your app.

If you're comparing options, start with how Draxlr connects to Databricks and the embedded analytics tool overview. For a wider view of the tools available, see Databricks reporting tools.


FAQs

1. Can I embed a Databricks dashboard in my app?

Yes. Connect a Databricks SQL warehouse to a BI tool that supports embedding, build the dashboard, and paste the embed code into your app. Draxlr provides HTML, React and Vue embed code and a backend API mode for customer-facing dashboards.

2. Which Databricks credentials do I need?

You need the SQL warehouse server hostname, the HTTP path and a personal access token from a user who can read the tables. Draxlr also asks for the catalog and schema to work in.

3. How do I show each customer only their own data?

Use row-level security. Create a permission with a row rule such as account_id equals accountId, attach it to an RLS group, and have your backend send the group and the customer's attribute values in the embed token.

4. Will the embedded dashboard update when the Databricks data changes?

Yes. Each load queries your live Delta tables through the SQL warehouse, so the dashboard shows the latest data without redeploying your app.

5. Does embedding use extra Databricks compute?

Yes. Each time a dashboard loads, its queries run on your SQL warehouse, so compute use grows with the number of loads and the cost of each query. Keep dashboards focused and set the warehouse auto-stop to match your traffic.

About the author

Vivek, Founder of Draxlr

Vivek is a coder and the founder of Draxlr who cares deeply about building good products. He works at the intersection of AI, SQL, dashboards, and embedded analytics, with a strong focus on making complex data workflows feel simple, useful, and fast for real teams.

If you have questions about anything in this guide, or want to compare options for your specific stack, you can email Vivek at vivek@draxlr.com, try Draxlr free, or reach out directly through the Draxlr team.

Related Blogs

Start free today

Every piece of your analytics, in one place.

Connect your database and the rest falls into place. Your first dashboard is minutes away.

No credit card required

This website uses cookies to ensure you get the best experience.