Docs/API Reference/Plugins

Plugins API: contract quick reference

PluginManifest carries plugin identity/version and optional metadata such as description, dependencies, extensions, enabled/system flags, setup status and author.…

2 min read

Manifest#

PluginManifest carries plugin identity/version and optional metadata such as description, dependencies, extensions, enabled/system flags, setup status and author. PluginManifestSchema is the Zod schema; createManifestFromPackageJson() derives a manifest from the veap field and standard package metadata.

IPlugin optional fields#

  • Lifecycle: init, onMigrate, onEnable, onDisable
  • Database: migrations
  • Extensibility: hooks, extensions, widgets
  • Navigation: navigation
  • Composition: plugins, locales
  • Routing: routeTree

Middleware contracts#

VeapMiddleware receives a VeapMiddlewareContext and a next() function returning a React node. ApiMiddleware receives a Request, context and a next() returning a Response. These are distinct contracts; do not pass a React middleware into an API route pipeline.

Route tree#

The router subpath exports route-tree types and discovery/matching helpers. A route tree may be returned directly or through a function returning a value/promise. Route discovery callbacks must be compatible with the host bundler's module-resolution rules.

See also#

veap
Preparing0%