Skip to content

Plugin manifest

Manifest fields, the bundle contract, and the trust hash.

Every plugin ships a manifest.json and a single JavaScript bundle. The manifest declares what the plugin needs; the kernel validates both before a merchant can install the release.

Example

{
  "schemaVersion": 1,
  "id": "edgecart.loyalty",
  "name": "Loyalty Discount",
  "version": "1.0.0",
  "description": "Applies a merchant-configured order discount.",
  "license": "MIT",
  "runtime": "sandboxed",
  "capabilities": ["discounts:propose", "settings", "admin:ui"],
  "hooks": ["cart:calculate"],
  "admin": {
    "settings": [
      {
        "name": "percent",
        "label": "Discount percent",
        "type": "number",
        "required": true,
        "min": 1,
        "max": 50,
        "default": 5
      }
    ]
  },
  "limits": { "cpuMs": 20, "wallMs": 500 }
}

Top-level fields

Field Required Meaning
schemaVersion Yes Must be 1.
id Yes Reverse-domain id, such as edgecart.loyalty. An id is bound to the first publisher that released it.
name Yes Display name.
version Yes SemVer version.
description No Short description shown in the catalog.
license No SPDX license identifier.
publisher No Publisher metadata; the name must match the authenticated publisher.
engines.edgecart No SemVer range of compatible EdgeCart versions.
runtime Yes sandboxed (the supported runtime) or native.
capabilities Yes The permissions the plugin requests. All are granted together at install.
hooks Yes The hooks the plugin implements.
allowedHosts Conditionally Hosts the plugin may call. Required for network:request; absolute iframe URLs must be listed.
storage No Named collections and their indexes/unique indexes.
routes No Plugin routes with permission or public.
admin No Settings, pages, blocks, and order panels.
storefront No Storefront slot blocks.
limits No cpuMs (1–100), subRequests (0–50), wallMs (1–5000).
assets No entry and basePath for static assets.

Bundle contract

The bundle is one self-contained JavaScript module, at most 10 MiB. It exports a default object with a fetch handler:

export default {
  async fetch(request) {
    const invocation = await request.json();
    return Response.json({ ok: true, value: {} });
  },
};
  • Success: { "ok": true, "value": ... }.
  • Failure: { "ok": false, "error": { "code": "...", "message": "..." } }.

The host validates every result. For cart hooks, the plugin proposes adjustments; the host recalculates totals from line values.

Validation

node --experimental-strip-types packages/plugin-cli/bin/edgecart-plugin.mjs \
  validate examples/plugins/loyalty/manifest.json

Validation prints the plugin id, version, and trust hash. The trust hash is computed over the canonical contract: capabilities, allowed hosts, storage, hooks, routes, admin/storefront declarations, and limits. The install dialog shows it so a merchant can confirm what they are consenting to.

Admin and storefront sections

  • admin.settings — schema-driven settings fields (string, number, boolean, select, secret).
  • admin.pages — declared console pages (path, label, icon).
  • admin.blocks — blocks rendered on the installed plugin card.
  • admin.orderPanel — blocks rendered on the order detail page.
  • storefront.slots — blocks for the fixed storefront slots.

See Capabilities and hooks, Settings, secrets and storage, Admin UI with Block Kit, and Storefront slots and blocks.

Type to search…

↑↓ navigate↵ selectEsc close