Docs/Guides/Plugins

Plugin contract

The source IPlugin contract supports a manifest, optional migrations, lifecycle callbacks (init, onMigrate, onEnable, onDisable), hooks, extensions, widgets, navigation, nested…

1 min read

The source IPlugin contract supports a manifest, optional migrations, lifecycle callbacks (init, onMigrate, onEnable, onDisable), hooks, extensions, widgets, navigation, nested plugins, locales and an optional routeTree.

ts
import type { IPlugin } from "@veap/plugins";

export const ExamplePlugin: IPlugin = {
  manifest: {
    id: "example-analytics",
    name: "Example Analytics",
    version: "1.0.0",
    dependencies: [],
    enabled: true,
  },
  async init() {
    // Initialize plugin-owned server resources.
  },
  extensions: [],
  widgets: [],
};

This is a contract-shape example, not a complete installer. The inspected package exports createManifestFromPackageJson(pkg), which reads pkg.veap metadata and falls back to package metadata. A PluginManifestSchema Zod schema is also available from the common types module; verify the public import path before using it.

veap
Preparing0%