Skip to content

Plugin contributions

A definePlugin closure can contribute to six surfaces. Each surface is owned by a different @nwire/* package — knowing which package owns what helps you understand why an import resolves where it does, and which surfaces are available in a slim runtime (e.g. when you skip @nwire/forge and use @nwire/app standalone).

SurfaceBuilder methodOwning packageRequired when
DI bindingsbind(token, factory)@nwire/containerAny plugin that exposes a service
Framework eventson(EventKind, fn)@nwire/appReacting to lifecycle
Action eventsbefore/after(action, fn)@nwire/forgeCross-cutting policy / audit
HTTP middlewaremiddleware(fn)@nwire/httpRequest-scoped logic
Actor hooksactorHooks({ onLoad, onSave })@nwire/forgeAggregate observability
Route mountsroutes(api => ...)@nwire/httpPlugins shipping endpoints
Named hookshooks(reg => ...)@nwire/forgePipelines + extension points

See also

MIT licensed.