Skip to content

Plugin contracts and extension points ​

This page is Plugin Development β†’ Backend β†’ Advanced: what plugin contracts are, how they relate to the rest of the backend plugin surface, and where to implement them. For file layout and step-by-step wiring, follow the Golden Path β€” Backend.

Plugin contracts ​

A plugin contract is a named service object your plugin registers so other plugins (or core) can call it without going through HTTP. Typical uses: shared helpers, cross-plugin orchestration, or stable β€œAPI surfaces” that stay versioned with your npm package.

  • You choose the contract id and the shape of the exported object (method names are entirely up to you).
  • Registration happens from backend code β€” see Plugin index.ts for where registerPluginContract fits in the startup sequence.
  • Convention still helps: if your service methods mirror predictable CRUD-style names (get, getAll, create, update, delete, …), other plugins and future generic tooling have a much easier time consuming your contract. The Golden Path β€” Service page ties this to routes and payloads.

For cross-plugin patterns in more depth (naming, evolution), see Cross-plugin communication on Service.

Other extension points (same backend plugin) ​

Beyond contracts, a backend plugin usually touches several registration hooks that the loader and generators observe:

Full backend reference (single document) ​

The Plugin Backend Side guide is still available as one consolidated document alongside the split between Fundamentals, Backend overview, and Golden Path; use it when you want the whole backend side story in linear form.