Apache Superset's extension system is designed to enable powerful customization while maintaining stability, security, and performance. This page explains the architectural principles, system design, and technical mechanisms that make the extension ecosystem possible.
The extension architecture is built on six core principles that guide all technical decisions and ensure extensions can be developed safely and predictably:
Superset's core should remain minimal, with many features delegated to extensions. Built-in features use the same APIs and extension mechanisms available to external developers. This approach:
All extension points are clearly defined and documented. Extension authors know exactly where and how they can interact with the host system. Both backend and frontend contributions are registered directly in code — backend contributions via classes decorated with @api (and other decorators) imported from the auto-discovered entrypoint, frontend contributions via calls like views.registerView and commands.registerCommand executed at module load time in index.tsx. This gives the host clear visibility into what each extension provides:
Public interfaces for extensions follow semantic versioning, allowing for:
Extensions are loaded and activated only when needed, which:
The architecture encourages reusing extension points and patterns across different modules, promoting:
The system evolves based on real-world feedback and contributions. New extension points and capabilities are added as needs emerge, ensuring the platform remains relevant and flexible.
The extension architecture is built around three main components that work together to create a flexible, maintainable ecosystem:
Two core packages provide the foundation for extension development:
Frontend: @apache-superset/core
This package provides essential building blocks for frontend extensions and the host application:
By centralizing these resources, both extensions and built-in features use the same APIs, ensuring consistency, type safety, and a seamless user experience. The package is versioned to support safe platform evolution while maintaining compatibility.
Backend: apache-superset-core
This package exposes key classes and APIs for backend extensions:
It includes dependencies on critical libraries like Flask-AppBuilder and SQLAlchemy, and follows semantic versioning for compatibility and stability.
apache-superset-extensions-cli
The CLI provides comprehensive commands for extension development:
By standardizing these processes, the CLI ensures extensions are built consistently, remain compatible with evolving versions of Superset, and follow best practices.
The Superset host application serves as the runtime environment for extensions:
Extension Management
/api/v1/extensions endpoint for registration and managementextensions database tableExtension Storage
The extensions table contains:
The following diagram illustrates how these components work together:
The diagram shows:
One of the most sophisticated aspects of the extension architecture is how frontend code is dynamically loaded at runtime using Webpack's Module Federation.
The architecture leverages Webpack's Module Federation to enable dynamic loading of frontend assets. This allows extensions to be built independently from Superset.
Extension Configuration
Extensions configure Webpack to expose their entry points:
externalsType: 'window', externals: { '@apache-superset/core': 'superset', }, plugins: [ new ModuleFederationPlugin({ name: 'my_extension', filename: 'remoteEntry.[contenthash].js', exposes: { './index': './src/index.tsx', }, shared: { react: { singleton: true, import: false }, 'react-dom': { singleton: true, import: false }, antd: { singleton: true, import: false }, }, }), ]
This configuration does several important things:
exposes - Declares which modules are available to the host application. Superset always loads extensions by requesting the ./index module from the remote container — this is a fixed convention, not a configurable value. Extensions must expose exactly './index': './src/index.tsx' and place all API registrations (views, commands, menus, editors, event listeners) in that file. The module is executed as a side effect when the extension loads, so any call to views.registerView, commands.registerCommand, etc. made at the top level of index.tsx will run automatically.
externals and externalsType - Tell Webpack that when the extension imports @apache-superset/core, it should use window.superset at runtime instead of bundling its own copy. This ensures extensions use the host's implementation of shared packages.
shared - Prevents duplication of common libraries like React and Ant Design. The singleton: true setting ensures only one instance of each library exists, avoiding version conflicts and reducing bundle size.
The following diagram illustrates the module loading process:
Here's what happens at runtime:
@apache-superset/core, which resolves to window.supersetOn the Superset side, the APIs are mapped to window.superset during application bootstrap:
import * as supersetCore from '@apache-superset/core'; export default function setupExtensionsAPI() { window.superset = { ...supersetCore, }; }
This function runs before any extensions are loaded, ensuring the APIs are available when extensions import from @apache-superset/core.
This architecture provides several key benefits:
Now that you understand the architecture, explore: