---
title: "Plugin guide"
description: "Extend EdgeCart with sandboxed plugins — manifests, hooks, admin UI, storefront slots, and publishing."
---

> Documentation Index
> Fetch the complete documentation index at: https://edgecart.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Plugin guide

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. |

## Read next

- [Build your first plugin](https://edgecart.dev/plugins/quickstart) — the loyalty
  discount example from manifest to install.
- [Plugin manifest](https://edgecart.dev/plugins/manifest) — every field and the bundle
  contract.
- [Capabilities and hooks](https://edgecart.dev/plugins/capabilities-hooks) — the full
  permission and hook reference.
- [PluginContext](https://edgecart.dev/plugins/context) — the API available inside a
  plugin.
- [Settings, secrets and storage](https://edgecart.dev/plugins/settings-storage).
- [Admin UI with Block Kit](https://edgecart.dev/plugins/admin-ui).
- [Storefront slots and blocks](https://edgecart.dev/plugins/storefront).
- [CLI and registry publishing](https://edgecart.dev/plugins/cli-registry).

> **Full-capability consent**
>
> Installing a plugin grants every capability in its manifest at once. Partial
> grants are not supported. The consent dialog shows the trust hash,
> capabilities, and allowed hosts before installation.

## Related

- [Understand the Cart module](https://edgecart.dev/modules/cart)
- [Understand the Orders module](https://edgecart.dev/modules/orders)
- [Deployment](https://edgecart.dev/developers/deployment)

Source: https://edgecart.dev/plugins/index.mdx
