@nodevo/plugin-sdk
v1.0.0-alpha.1
Published
The authoring contract for Nodevo CMS plugins.
Downloads
173
Readme
@nodevo/plugin-sdk
The authoring contract for Nodevo CMS plugins.
pnpm add @nodevo/plugin-sdk@alphaimport type { PluginDefinition, PluginContext } from "@nodevo/plugin-sdk";
export default {
id: "my-plugin",
async onEnable(ctx: PluginContext) {
await ctx.registerPermissions([
{ key: "myplugin.thing.create", label: "Create things", domain: "My Plugin" },
]);
ctx.registerRoutes(router);
ctx.registerSearchSource(mySearchSource);
ctx.registerAcpPage({ section: "My Plugin", label: "Settings", path: "/admin/my-plugin" });
},
} satisfies PluginDefinition;A plugin runs inside the host process but reaches core only through this
contract — no unrestricted access to internals. ctx.host hands you what the
host already has (prisma, queues, logger, auth middleware), so a plugin
should not install @nodevo/server-kit, @nodevo/auth or
@nodevo/plugin-engine: those are already running, and your own copy would be a
second, unconnected instance.
Layering
The application-agnostic half lives in
@nodevo/plugin-kit and is
re-exported here in full, so one import still gets you everything. The split
exists so a plugin for a different Nodevo-framework application has something to
build against that does not assume a CMS.
Full walkthrough: Plugin development guide.
Part of the Nodevo framework.
MIT © Slaxxer
