PADISO.ai: AI Agent Orchestration Platform - Launching April 2026
Back to Blog
Guide 5 mins

Embedding Apache Superset Dashboards in Your SaaS Product

Complete guide to white-label embedding Superset dashboards using SDK and JWT auth for customer-facing analytics in your SaaS product.

Padiso Team ·2026-04-17

Embedding Apache Superset Dashboards in Your SaaS Product

Table of Contents

  1. Why Embed Superset Dashboards in Your SaaS
  2. Understanding Superset Embedding Architecture
  3. Authentication with JWT Tokens
  4. SDK Setup and Configuration
  5. Implementing White-Label Embedding
  6. Security Best Practices
  7. Performance Optimization
  8. Troubleshooting Common Issues
  9. Real-World Implementation Examples
  10. Next Steps and Scaling

Why Embed Superset Dashboards in Your SaaS

Embedding analytics directly into your SaaS product transforms the user experience. Instead of forcing customers to log into a separate analytics platform, they access insights within your application. This approach reduces friction, increases engagement, and creates a seamless workflow for decision-makers.

Apache Superset is an open-source data visualisation platform that has become the backbone for analytics in thousands of SaaS products. Its embedding capabilities are powerful—you can embed entire dashboards, individual charts, or create fully customised analytics experiences. The flexibility makes it ideal for founders and CTOs building analytics-heavy products, especially those pursuing AI readiness and automation strategies to modernise their tech stack.

The business case is straightforward. Embedded analytics increase customer stickiness, reduce support burden (customers find answers themselves), and unlock new revenue opportunities. You can charge a premium for analytics-enabled tiers or use embedded dashboards to justify higher pricing across the board.

For Sydney-based startups and enterprises modernising their operations, embedding Superset dashboards is a practical way to accelerate time-to-value without building custom analytics from scratch. This is especially relevant if you’re working with a venture studio partner or fractional CTO to co-build your product and validate market fit quickly.


Understanding Superset Embedding Architecture

How Superset Embedding Works

Superset’s embedding model relies on three core components: the Superset server, your SaaS application, and your end users. The Superset server hosts all dashboards, data connections, and metadata. Your SaaS application acts as the intermediary, handling user authentication and generating secure tokens. End users never directly authenticate with Superset—they only see embedded content within your product.

This architecture offers several advantages. First, it decouples your analytics layer from your core product, allowing independent scaling. Second, it keeps user credentials secure—your SaaS app controls access, not Superset. Third, it enables white-labelling, so customers never know Superset is powering the analytics.

Superset supports multiple embedding approaches. The SDK method is most flexible and recommended for production SaaS products. The Apache Superset documentation on network and security settings outlines how to configure HTML embedding of dashboards and charts using the SDK or direct links, including public role configuration and Content Security Policy settings.

Direct URL embedding works for simple use cases—you generate a URL with a JWT token and embed it in an iframe. This approach is faster to implement but offers less control over styling and interactivity.

The SDK method gives you full programmatic control. You can render dashboards dynamically, pass runtime filters, control refresh rates, and customise the visual appearance. For most SaaS products, the SDK is the right choice because it enables the tight integration customers expect.

Role-Based Access Control

Superset’s embedding system respects role-based access control (RBAC). You define roles in Superset (e.g., “analyst”, “viewer”, “admin”), assign permissions to dashboards and datasets, and then map your SaaS users to those roles via JWT claims. This ensures users only see data they’re authorised to access.

For example, a multi-tenant SaaS product can create one role per customer account. Each role has permissions limited to that customer’s datasets and dashboards. When your SaaS app generates a JWT token for a user, it includes the customer’s role. Superset validates the token, loads the user’s role, and enforces permissions automatically.


Authentication with JWT Tokens

What Are JWT Tokens and Why They Matter

JSON Web Tokens (JWT) are the foundation of secure Superset embedding. A JWT is a compact, URL-safe token that contains encoded claims (e.g., user ID, role, customer account). Your SaaS application generates JWTs and passes them to the Superset SDK. Superset verifies the token’s signature using a shared secret key, then trusts the claims inside.

JWTs are stateless—Superset doesn’t need to query a database to validate them. This makes embedding fast and scalable. The token includes an expiration time, so tokens automatically become invalid after a set period (typically 15 minutes to 1 hour).

Generating JWT Tokens Securely

Your SaaS backend generates JWTs when a user requests an embedded dashboard. Here’s the workflow:

  1. User logs into your SaaS app (standard authentication flow).
  2. User navigates to a page with an embedded dashboard.
  3. Your backend generates a JWT containing the user’s ID, role, and customer account.
  4. Your frontend receives the JWT and passes it to the Superset SDK.
  5. The SDK uses the JWT to authenticate with Superset and render the dashboard.

The critical security principle: never expose your JWT signing secret to the frontend. The secret must remain on your backend. Only your backend generates JWTs; the frontend only passes them to the SDK.

JWT Claims and Payload Structure

A typical JWT payload for Superset embedding looks like this:

{
  "iss": "your-saas-app",
  "sub": "user-123",
  "aud": "superset",
  "user": {
    "username": "alice@customer.com",
    "email": "alice@customer.com",
    "first_name": "Alice",
    "last_name": "Smith"
  },
  "roles": ["customer-456-viewer"],
  "exp": 1700000000,
  "iat": 1699999000
}

The roles claim is crucial for multi-tenant products. Each customer gets a unique role, and Superset enforces permissions based on that role. The exp (expiration) claim ensures the token becomes invalid after a set time.

Signing and Verification

Your backend signs the JWT using a secret key (e.g., HS256 algorithm). Superset is configured with the same secret key. When Superset receives a token, it verifies the signature matches. If the signature is invalid or the token has expired, Superset rejects the request.

For maximum security, rotate your signing key periodically (e.g., quarterly). Superset supports multiple keys during rotation, so you can deploy a new key without breaking existing tokens.


SDK Setup and Configuration

Installing the Superset Embedding SDK

Superset provides an official JavaScript SDK for embedding. Install it via npm:

npm install @superset-ui/embedded-sdk

The SDK handles token management, iframe communication, and event listeners. It abstracts away the complexity of direct iframe embedding.

Configuring the SDK in Your Application

Initialise the SDK in your frontend application:

import { EmbedDashboard } from "@superset-ui/embedded-sdk";

const SupersetEmbedded = () => {
  return (
    <EmbedDashboard
      url="https://your-superset-instance.com"
      id={3} // Dashboard ID in Superset
      height={600}
      width="100%"
      onChange={(data) => console.log(data)}
    />
  );
};

This basic example embeds a dashboard with ID 3 from your Superset instance. However, this approach doesn’t include authentication—any user can view the dashboard. For production, you need to add JWT authentication.

Adding JWT Authentication to the SDK

Modify the component to fetch a JWT from your backend and pass it to the SDK:

import { EmbedDashboard } from "@superset-ui/embedded-sdk";
import { useEffect, useState } from "react";

const SupersetEmbedded = ({ dashboardId }) => {
  const [token, setToken] = useState(null);
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    // Fetch JWT from your backend
    fetch("/api/superset-token", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ dashboardId }),
    })
      .then((res) => res.json())
      .then((data) => {
        setToken(data.token);
        setLoading(false);
      })
      .catch((err) => {
        console.error("Failed to fetch token", err);
        setLoading(false);
      });
  }, [dashboardId]);

  if (loading) return <div>Loading dashboard...</div>;
  if (!token) return <div>Failed to load dashboard</div>;

  return (
    <EmbedDashboard
      url="https://your-superset-instance.com"
      id={dashboardId}
      token={token}
      height={600}
      width="100%"
    />
  );
};

export default SupersetEmbedded;

Your backend endpoint (/api/superset-token) verifies the user is authenticated, checks their permissions, generates a JWT, and returns it. The frontend then passes the token to the SDK.

Configuring Superset for Embedding

Your Superset instance must be configured to accept embedded requests. Update the superset_config.py file:

# Enable embedding
FEATURE_FLAGS = {
    "EMBEDDED_SUPERSET": True,
}

# Configure CORS for your SaaS domain
CORS_ORIGINS = ["https://your-saas-app.com"]

# Set JWT signing key
JWT_SECRET_KEY = "your-super-secret-key-change-this"

# Configure JWT algorithm
JWT_ALGORITHM = "HS256"

The JWT_SECRET_KEY must match the key your backend uses to sign JWTs. The CORS_ORIGINS setting allows your SaaS domain to make requests to Superset. Without proper CORS configuration, browsers will block requests.


Implementing White-Label Embedding

Removing Superset Branding

White-label embedding means customers don’t see “Superset” anywhere in the interface. Superset’s SDK supports CSS customisation to hide branding elements. When you embed a dashboard, you can inject custom CSS to modify the appearance.

Here’s how to hide the Superset logo and navigation:

const customCss = `
  .ant-layout-header { display: none; }
  .navbar { display: none; }
  .superset-logo { display: none; }
`;

const SupersetEmbedded = ({ dashboardId }) => {
  return (
    <EmbedDashboard
      url="https://your-superset-instance.com"
      id={dashboardId}
      token={token}
      height={600}
      width="100%"
      cssOverrides={customCss}
    />
  );
};

The cssOverrides prop allows you to inject custom CSS that targets Superset’s DOM elements. This is a simple but effective way to achieve white-labelling.

Customising the Dashboard Appearance

Beyond hiding branding, you can customise colours, fonts, and layout to match your product’s design system. For example, to change the dashboard background and text colours:

const customCss = `
  .dashboard { background-color: #f5f5f5; }
  .chart-title { color: #333; font-family: 'Inter', sans-serif; }
  .dashboard-grid-container { padding: 20px; }
`;

The GitHub issue on dynamically styling embedded dashboards discusses advanced CSS injection techniques via the embedding API and custom CSS injection, which is valuable for teams building highly customised analytics experiences.

Controlling Dashboard Interactivity

You can control which features are available in embedded dashboards. For example, you might want to disable the export button or hide the refresh interval selector. The SDK supports configuration options to control these:

<EmbedDashboard
  url="https://your-superset-instance.com"
  id={dashboardId}
  token={token}
  height={600}
  width="100%"
  editMode={false} // Disable editing
  showHeader={false} // Hide header
  showFilters={true} // Show filters
/>

These options let you create a tailored experience for each customer segment. Free-tier customers might see read-only dashboards, while premium customers get interactive filters and drill-down capabilities.

Multi-Tenant Customisation

For multi-tenant SaaS products, you can apply customer-specific customisation by passing customer metadata in the JWT:

const jwtPayload = {
  user: { username: "alice@customer.com" },
  roles: ["customer-456-viewer"],
  customer: {
    id: "customer-456",
    branding: {
      primaryColor: "#007bff",
      logoUrl: "https://cdn.customer.com/logo.png",
    },
  },
};

Your frontend can read this metadata and apply customer-specific CSS. This approach scales to hundreds of customers without duplicating code.


Security Best Practices

Token Expiration and Refresh

Tokens should have short expiration times (15–60 minutes). When a token expires, the user’s dashboard becomes inaccessible. Your frontend should handle token refresh gracefully.

Implement a token refresh mechanism:

const SupersetEmbedded = ({ dashboardId }) => {
  const [token, setToken] = useState(null);
  const tokenExpiryRef = useRef(null);

  const fetchToken = async () => {
    const response = await fetch("/api/superset-token", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ dashboardId }),
    });
    const data = await response.json();
    setToken(data.token);
    // Refresh token 5 minutes before expiry
    tokenExpiryRef.current = setTimeout(
      fetchToken,
      data.expiresIn * 1000 - 300000
    );
  };

  useEffect(() => {
    fetchToken();
    return () => clearTimeout(tokenExpiryRef.current);
  }, []);

  if (!token) return <div>Loading...</div>;

  return (
    <EmbedDashboard
      url="https://your-superset-instance.com"
      id={dashboardId}
      token={token}
      height={600}
      width="100%"
    />
  );
};

This component automatically refreshes the token before it expires, ensuring a seamless user experience.

Securing the JWT Secret

Your JWT signing secret is the crown jewel of your security model. Treat it like a database password:

  1. Never commit it to version control. Use environment variables or a secrets manager (e.g., AWS Secrets Manager, HashiCorp Vault).
  2. Rotate it periodically. Change the secret every 90 days.
  3. Use strong entropy. Generate a 256-bit random key, not a simple passphrase.
  4. Restrict access. Only backend servers should have access to the secret.

For Sydney-based startups working with a security-focused partner, integrating JWT secrets into your secrets management system is part of achieving SOC 2 and ISO 27001 compliance via Vanta.

Row-Level Security (RLS)

Superset supports row-level security, which restricts data at the database level based on user roles. This is essential for multi-tenant products where customer A must never see customer B’s data.

Implement RLS by:

  1. Creating a view or query that filters data based on a user context variable.
  2. Configuring Superset to pass the user’s role as a context variable to the database.
  3. Defining RLS rules in your database (e.g., SQL WHERE clauses based on customer ID).

For example, a PostgreSQL view with RLS:

CREATE VIEW customer_metrics AS
SELECT *
FROM metrics
WHERE customer_id = current_setting('app.current_customer_id')::int;

When Superset queries this view, it sets the app.current_customer_id based on the user’s JWT role. The database automatically filters results to only the customer’s data.

Network Security and CSP

Configure Content Security Policy (CSP) headers to prevent XSS attacks. Your Superset instance should enforce strict CSP:

Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';

Also, use HTTPS everywhere. Tokens should only be transmitted over encrypted connections. Superset should be behind a reverse proxy (e.g., Nginx) that enforces HTTPS and handles SSL termination.


Performance Optimization

Caching and Query Performance

Embedded dashboards can be slow if underlying queries are slow. Optimise performance by:

  1. Caching query results. Superset supports result caching with configurable TTLs. Set cache durations based on data freshness requirements.
  2. Indexing databases. Ensure your data warehouse has proper indexes on columns used in filters and joins.
  3. Aggregating data. Pre-aggregate data in a data mart or warehouse instead of querying raw tables.

Configure caching in superset_config.py:

CACHE_CONFIG = {
    "CACHE_TYPE": "redis",
    "CACHE_REDIS_URL": "redis://localhost:6379/0",
    "CACHE_DEFAULT_TIMEOUT": 300,  # 5 minutes
}

Lazy Loading and Pagination

For dashboards with many charts, implement lazy loading. Charts below the fold load only when the user scrolls into view. This reduces initial load time and improves perceived performance.

The Superset SDK supports lazy loading via the onLoad callback:

<EmbedDashboard
  url="https://your-superset-instance.com"
  id={dashboardId}
  token={token}
  height={600}
  width="100%"
  onLoad={() => console.log("Dashboard loaded")}
/>

Optimising for Mobile

Embedded dashboards must work on mobile devices. Use responsive CSS to adapt layouts:

const customCss = `
  @media (max-width: 768px) {
    .dashboard-grid-container { padding: 10px; }
    .chart { width: 100% !important; }
  }
`;

Test dashboards on various devices to ensure readability and usability.

Monitoring and Observability

Set up monitoring to track embedding performance. Key metrics include:

  1. Token generation latency. How long does it take your backend to generate a JWT?
  2. Dashboard load time. How long from request to rendered dashboard?
  3. Query execution time. How long do underlying database queries take?
  4. Error rates. What percentage of embedding requests fail?

Use application performance monitoring (APM) tools like DataDog or New Relic to track these metrics. Alert on anomalies (e.g., if dashboard load time exceeds 5 seconds).


Troubleshooting Common Issues

CORS Errors

If you see “Access-Control-Allow-Origin” errors in the browser console, CORS is misconfigured. Verify that your SaaS domain is in Superset’s CORS_ORIGINS list:

CORS_ORIGINS = ["https://your-saas-app.com", "https://staging.your-saas-app.com"]

After updating, restart Superset and clear your browser cache.

Token Validation Failures

If Superset rejects tokens with “Invalid token” errors, check:

  1. Signing key mismatch. Ensure your backend and Superset use the same JWT_SECRET_KEY.
  2. Algorithm mismatch. Both must use the same algorithm (e.g., HS256).
  3. Token expiration. Is the token expired? Check the exp claim.
  4. Signature corruption. Did you modify the token after signing it?

Debug by decoding the JWT at jwt.io to inspect the claims.

Dashboard Not Loading

If the dashboard loads but shows no content:

  1. Check dashboard permissions. Does the user’s role have permission to view the dashboard?
  2. Verify data connections. Is Superset able to connect to the underlying database?
  3. Inspect browser console. Look for JavaScript errors or network failures.
  4. Check Superset logs. Review /var/log/superset/superset.log for backend errors.

Performance Issues

If dashboards load slowly:

  1. Profile queries. Use Superset’s query profiling to identify slow queries.
  2. Check cache hit rates. Are queries being cached effectively?
  3. Monitor database load. Is the database under heavy load?
  4. Review network latency. Is there high latency between your SaaS app and Superset?

Real-World Implementation Examples

Example 1: Multi-Tenant SaaS Analytics

A project management SaaS product embeds Superset dashboards to show customers their project metrics (tasks completed, team utilisation, budget spent). Each customer sees only their own data via row-level security.

Implementation:

  1. Create a Superset role per customer (e.g., “acme-corp-viewer”).
  2. Create dashboards with RLS filters that respect the role.
  3. In the SaaS backend, generate a JWT with the customer’s role.
  4. Embed the dashboard in the customer’s workspace.

Result: Customers access analytics without logging into Superset. The company can charge a premium for analytics-enabled plans.

Example 2: Executive Dashboard for Private Equity

A portfolio company tracking tool embeds Superset dashboards in a private equity firm’s platform. Executives see real-time KPIs for all portfolio companies (revenue, growth rate, burn rate, CAC).

Implementation:

  1. Create a Superset dataset that aggregates data from all portfolio companies.
  2. Create dashboards with filters for company, time period, and metric.
  3. Generate JWTs that include the executive’s permissions (which companies they can view).
  4. Embed dashboards with pre-filtered data based on the JWT.

Result: Executives get instant visibility into portfolio performance. The platform becomes stickier and justifies higher pricing.

Example 3: White-Labeled Analytics for a Data Consultancy

A data consultancy builds a SaaS platform for clients to self-serve analytics. They embed Superset dashboards branded with each client’s logo and colours.

Implementation:

  1. Create a multi-tenant Superset instance with one dataset per client.
  2. Use JWT claims to pass client branding metadata (logo URL, primary colour).
  3. Apply CSS overrides to hide Superset branding and apply client branding.
  4. Implement custom filters for each client’s data.

Result: Clients see a fully branded analytics platform. The consultancy can scale to many clients without duplicating work.


Next Steps and Scaling

Evaluating Superset vs. Alternatives

Superset is powerful and open-source, but it’s not the only option. The technical comparison of Embeddable and Preset covers performance and iframe embedding considerations. Metabase’s blog on embedding Superset alternatives provides a broader comparison. Evaluate based on your specific needs: cost, ease of deployment, customisation flexibility, and support.

For Sydney-based teams evaluating analytics platforms as part of a broader AI and automation strategy, consider how analytics integrates with your data pipeline and AI models.

Scaling Superset for High Traffic

As your SaaS product grows, Superset must handle increased traffic. Scaling strategies include:

  1. Horizontal scaling. Run multiple Superset instances behind a load balancer.
  2. Caching layer. Use Redis or Memcached to cache query results and reduce database load.
  3. Separate data warehouse. Offload analytics queries to a dedicated warehouse (Snowflake, BigQuery, Redshift) separate from your transactional database.
  4. Query optimisation. Continuously profile and optimise slow queries.

Integrating with Your AI and Automation Strategy

Embedded analytics become more powerful when combined with AI. For example, you could:

  1. Add AI-driven insights. Use machine learning to detect anomalies, forecast trends, or recommend actions based on dashboard data.
  2. Automate report generation. Use AI agents to generate written summaries of dashboards and email them to stakeholders.
  3. Implement natural language queries. Allow users to ask questions in plain English and automatically generate visualisations.

These capabilities align with broader AI readiness and automation initiatives that help organisations modernise their tech stacks.

Monitoring and Continuous Improvement

After launching embedded dashboards, monitor usage and gather feedback:

  1. Track engagement. How often do users view dashboards? Which dashboards are most popular?
  2. Measure business impact. Do customers using analytics have higher retention or expansion revenue?
  3. Gather qualitative feedback. Interview customers about their analytics experience.
  4. Iterate on dashboards. Update dashboards based on usage patterns and feedback.

Treat embedded analytics as a product in its own right, not just a feature. Invest in its quality and evolution.

Working with a Technical Partner

Building and maintaining embedded analytics requires expertise in full-stack development, data engineering, and security. If your team lacks this expertise, partnering with a venture studio or fractional CTO can accelerate time-to-market and reduce risk.

A technical partner can help with:

  1. Architecture design. Designing a scalable, secure embedding architecture.
  2. Implementation. Building and testing the embedding system.
  3. Compliance. Ensuring your analytics platform meets SOC 2 and ISO 27001 requirements via Vanta.
  4. Optimisation. Continuously improving performance and user experience.

For Sydney businesses modernising their analytics capabilities, working with a local AI automation agency or AI advisory partner ensures you’re aligned with local market context and best practices.

Staying Updated with Superset Development

Superset is actively developed. Follow the official Apache Superset documentation and GitHub repository to stay informed about new features, security updates, and best practices. Subscribe to the Superset mailing list and attend community events.

Review the Preset event on embedding Superset dashboards to learn about the latest embedding features and real-world use cases from other teams.


Summary

Embedding Apache Superset dashboards in your SaaS product is a powerful way to deliver analytics directly to customers. By using JWT authentication, the Superset SDK, and white-label customisation, you can create seamless, secure analytics experiences that drive engagement and retention.

Key takeaways:

  1. Use JWT tokens for secure, stateless authentication. Generate tokens in your backend, never expose the signing secret.
  2. Implement role-based access control and row-level security. Ensure users only see authorised data.
  3. Customise the appearance to match your product. Hide Superset branding and apply your design system.
  4. Optimise for performance. Cache queries, lazy-load charts, and monitor key metrics.
  5. Treat embedded analytics as a product. Invest in quality, monitor usage, and iterate based on feedback.

Whether you’re a founder building an analytics-heavy SaaS product or an operator modernising your company’s analytics infrastructure, Superset embedding offers a flexible, cost-effective solution. Start with a proof of concept, validate the approach with early customers, and scale incrementally as you learn what works.

For teams in Sydney or Australia looking to embed analytics as part of a broader AI adoption and modernisation strategy, consider how embedded analytics integrates with your product roadmap and business objectives. The right technical partner can help you navigate the complexity and accelerate time-to-value.