Skip to content

Plugin guide

Extend EdgeCart with sandboxed plugins — manifests, hooks, admin UI, storefront slots, and publishing.

Plugins let you extend EdgeCart without running code inside the main Worker. A plugin is a signed JavaScript bundle that executes in a Dynamic Worker sandbox and talks to the host through a narrow bridge.

How a plugin runs

  1. A publisher signs a bundle and publishes a release.
  2. An operator reviews and approves the release in the plugin registry.
  3. A merchant installs it with full-capability consent.
  4. The kernel invokes the plugin for its declared hooks.
  5. The host validates every result and recalculates totals; the plugin never supplies a trusted total.

The plugin code runs in the edgecart-plugins Worker with its own D1 access, R2 bundle bucket, and LOADER binding. The main app reaches it through the PLUGIN_KERNEL service binding. Dynamic Workers require the Workers Paid plan in production.

What a plugin can do

Surface How it works
Cart and checkout Synchronous hooks such as cart:calculate and checkout:validate propose adjustments or decisions.
Orders and refunds Async action hooks (order:created, order:paid, refund:created) delivered through the outbox.
Admin UI Declarative Block Kit pages and order panels rendered by the host.
Storefront Declarative blocks in fixed slots, plus iframes and forms.
Storage and settings Per-install settings (including encrypted secrets) and key-value storage.
Network ctx.http.fetch with host allow-lists and secret-header injection.

Type to search…

↑↓ navigate↵ selectEsc close