Publish Plugin
Run the following commands in the monorepo root directory:Use Plugin
In the Xpert AI host system, declare the list of enabled plugins using thePLUGINS environment variable. Separate multiple plugins with commas:
PLUGINS environment variable and load these plugins in order.
Notes:
- The host project should install the plugin packages via npm/yarn/pnpm (
npm install @xpert-ai/my-plugin) and configure the plugin list in the environment variable. - The plugin’s
meta.namemust match the npm package name. - If a plugin fails to load correctly, check the logs for
registeroronPluginBootstrapoutput. - After starting the Xpert AI system, you can view the loaded plugins on the system settings Plugins page.
Installation Scope
Every installed plugin has an explicit level and scope. Level controls capability and lifecycle; scope controls installation placement:
Tenant level means more than installing a normal plugin into tenant-global scope. The plugin may register system-level technical capabilities such as controllers, TypeORM entities, and process-level providers, while product ownership and access remain limited to one tenant.
Install a Tenant-Level Plugin
Before installation, verify that runtimemeta and package.json declare the same level and namespace:
- Sign in as a Super Admin of the target tenant.
- Open the Plugins page in tenant administration scope and install the package.
- Restart the API service when the installation result requests it.
- Return to the target tenant and verify plugin status, configuration, Workbench views, and APIs.
- Switch to another tenant and verify that the plugin and business entry points are absent; direct plugin API requests must be denied.
- A plugin name can belong to only one tenant; a second tenant cannot install another copy.
- Install and update stage the artifact, and the new controllers, entities, and providers load after an API restart.
- Uninstall first deactivates the persisted registration; runtime removal completes after an API restart.
- Only a Super Admin in the owning tenant can manage its configuration.
artifactNamespacemust remain stable to prevent table, route, and registry collisions with other process-level plugins.
Migrate from System Level to Tenant Level
Do not change a plugin directly from system to tenant level while the old system registration is active. That could register two copies of process-level modules. Use this sequence:- In the Default tenant, have a Super Admin uninstall the old system plugin.
- Restart the API and verify that the old runtime module has been removed.
- Publish or prepare a new plugin version that declares
level = 'tenant'. - Install the new version as a Super Admin in the target tenant.
- Restart the API again to activate the tenant-level plugin.
- Validate business data and configuration in the target tenant, then run a cross-tenant isolation check.
Initialize Plugin Resources
Loading a plugin into the host is only the first step. The host can also initialize the resources declared inside the plugin bundle into the target runtime. On the Plugins page, the installed plugin card exposes a resource initialization action. Opening it launches a dialog that reads the current bundle definitions live, rather than relying on a stale cached list. Resources are split into two targets:- Workspace: initialize into a workspace for
Skills,MCP, andApps - Xpert: initialize into an existing Xpert for
Hooks
- Already initialized resources are marked as installed and cannot be selected again
- If the plugin bundle changes, the dialog can surface stale definitions as updateable resources
assets/are bundle metadata and presentation assets, not installable resources