The extension.json file defines metadata, capabilities, and configuration for a Superset extension. This file is required at the root of every extension project.
{ "name": "dataset_references", "displayName": "Dataset References", "version": "1.0.0", "description": "Display metadata about tables referenced in SQL queries", "author": "Apache Superset Contributors", "license": "Apache-2.0", "homepage": "https://github.com/apache/superset", "repository": { "type": "git", "url": "https://github.com/apache/superset.git" }, "bugs": { "url": "https://github.com/apache/superset/issues" }, "engines": { "superset": ">=4.0.0" }, "categories": ["SQL Lab", "Analytics"], "keywords": ["sql", "metadata", "tables", "references"], "icon": "database", "galleryBanner": { "color": "#1890ff", "theme": "dark" }, "frontend": { "main": "./dist/index.js", "contributions": { "views": { "sqllab.panels": [ { "id": "dataset_references.main", "name": "Dataset References", "icon": "TableOutlined", "when": "sqllab.queryExecuted" } ] }, "commands": [ { "command": "dataset_references.refresh", "title": "Refresh Dataset Metadata", "category": "Dataset References", "icon": "ReloadOutlined" } ], "menus": { "sqllab.editor": { "primary": [ { "command": "dataset_references.refresh", "group": "navigation", "when": "dataset_references.panelVisible" } ] } }, "configuration": { "title": "Dataset References", "properties": { "dataset_references.autoRefresh": { "type": "boolean", "default": true, "description": "Automatically refresh metadata on query execution" }, "dataset_references.showPartitions": { "type": "boolean", "default": true, "description": "Display partition information" }, "dataset_references.cacheTimeout": { "type": "number", "default": 300, "description": "Cache timeout in seconds" } } } }, "moduleFederation": { "name": "dataset_references", "exposes": { "./index": "./src/index" }, "shared": { "react": { "singleton": true }, "react-dom": { "singleton": true } } } }, "backend": { "main": "dataset_references.entrypoint", "entryPoints": ["dataset_references.entrypoint"], "files": ["backend/src/dataset_references/**/*.py"], "requirements": [ "sqlparse>=0.4.0", "pandas>=1.3.0" ] }, "activationEvents": [ "onView:sqllab.panels", "onCommand:dataset_references.refresh", "workspaceContains:**/*.sql" ] }
string^[a-z0-9_]+$"name": "my_extension"
string"version": "1.2.3"
object"engines": { "superset": ">=4.0.0 <5.0.0" }
stringstringstring | object"author": { "name": "Jane Doe", "email": "jane@example.com", "url": "https://example.com" }
stringApache-2.0, MIT, BSD-3-Clausestring[]"SQL Lab""Dashboard""Charts""Data Sources""Analytics""Security""Theming""Developer Tools"string[]stringstringDefines how the extension extends Superset's UI.
Register custom views and panels:
"views": { "sqllab.panels": [ { "id": "extension.panel", "name": "My Panel", "icon": "icon-name", "when": "condition" } ] }
View Locations:
sqllab.panels - SQL Lab side panelssqllab.bottomPanels - SQL Lab bottom panelsdashboard.widgets - Dashboard widgets (TODO: future)chart.toolbar - Chart toolbar items (TODO: future)Register executable commands:
"commands": [ { "command": "extension.doSomething", "title": "Do Something", "category": "My Extension", "icon": "PlayCircleOutlined", "enablement": "resourceIsSelected" } ]
Add items to existing menus:
"menus": { "sqllab.editor": { "primary": [ { "command": "extension.command", "group": "navigation", "when": "editorFocus" } ], "context": [ { "command": "extension.contextAction", "group": "1_modification" } ] } }
Menu Locations:
sqllab.editor.primary - Main SQL Lab toolbarsqllab.editor.secondary - Secondary actionssqllab.editor.context - Right-click context menuexplorer.context - Data explorer context menu (TODO: future)Define extension settings:
"configuration": { "title": "My Extension", "properties": { "myExtension.setting1": { "type": "boolean", "default": true, "description": "Enable feature X" }, "myExtension.setting2": { "type": "string", "enum": ["option1", "option2"], "default": "option1", "description": "Choose option" } } }
Property Types:
boolean - True/false togglestring - Text inputnumber - Numeric inputarray - List of valuesobject - Complex configurationWebpack Module Federation configuration:
"moduleFederation": { "name": "extension_name", "exposes": { "./index": "./src/index" }, "shared": { "react": { "singleton": true }, "react-dom": { "singleton": true }, "@apache-superset/core": { "singleton": true } } }
stringstring[]"entryPoints": [ "my_extension.api", "my_extension.security", "my_extension.models" ]
string[]"files": [ "backend/src/**/*.py", "backend/config/*.yaml" ]
string[]"requirements": [ "requests>=2.28.0", "pandas>=1.3.0,<2.0.0" ]
Controls when the extension is activated:
"activationEvents": [ "onView:sqllab.panels", "onCommand:myExtension.start", "onLanguage:sql", "workspaceContains:**/*.sql", "*" ]
Event Types:
onView:<viewId> - When specific view is openedonCommand:<commandId> - When command is executedonLanguage:<language> - When file type is openedworkspaceContains:<pattern> - When workspace contains matching filesonStartupFinished - After Superset fully starts* - Always activate (not recommended)Control when UI elements are visible/enabled:
"when": "sqllab.queryExecuted && config.myExtension.enabled"
Context Keys:
sqllab.queryExecuted - Query has been runsqllab.hasResults - Query returned resultseditorFocus - Editor is focusedresourceIsSelected - Resource selected in explorerconfig.<setting> - Configuration value checkOperators:
&& - AND|| - OR! - NOT== - Equals!= - Not equals=~ - Regex matchDeclare required permissions and capabilities:
"capabilities": { "permissions": [ "database.read", "query.execute", "cache.write" ], "apis": [ "sqllab.*", "authentication.getUser" ] }
These fields are planned for future implementation:
{ "publisher": "organization-name", "preview": false, "contributes": { "themes": [], "languages": [], "debuggers": [], "jsonValidation": [] }, "extensionDependencies": [ "other-extension@^1.0.0" ], "extensionPack": [ "extension1", "extension2" ], "scripts": { "compile": "webpack", "test": "jest", "lint": "eslint" } }
The manifest is validated against a JSON schema during:
superset-extensions dev)superset-extensions build)Common validation errors:
If migrating from older extension formats:
// Legacy format (deprecated) { "plugin_name": "MyPlugin", "plugin_version": "1.0" } // New format { "name": "my_plugin", "version": "1.0.0", "engines": { "superset": ">=4.0.0" } }