Skip to content

Storefront slots and blocks

Render plugin content in fixed storefront slots with declarative blocks and forms.

Plugins can add content to the storefront through fixed slots. The host renders validated blocks as text and form controls; plugins do not inject scripts into the storefront.

Slots

Declare blocks per slot in the manifest:

{
  "capabilities": ["storefront:ui"],
  "hooks": ["storefront:slot", "storefront:action"],
  "storefront": {
    "slots": {
      "product.detail.below": [
        {
          "type": "callout",
          "tone": "info",
          "title": "Loyalty members",
          "text": "Earn points on this order."
        }
      ]
    }
  }
}

Available slots:

  • product.detail.below
  • product.detail.sidebar
  • cart.footer
  • cart.empty
  • checkout.beforeSubmit
  • storefront.footer
  • storefront.chat

The storefront fetches slot blocks from GET /api/store/plugins/ui?slot=…. Responses are private so a shared cache cannot mix stores.

Blocks

Use the same declarative block shapes as the admin UI, with storefront-safe types such as text, callout, image, button, link, table, form, and iframe.

  • Blocks are bounded data; the host validates types, sizes, and URLs.
  • Iframes use a sandbox without allow-same-origin.
  • Absolute HTTPS iframe URLs must be in allowedHosts, or the plugin must hold network:request:unrestricted.
  • Static plugin assets are served by the assets Worker from a separate origin.

Forms

A storefront form posts to:

POST /api/store/plugins/forms/:installId/:formId

The host validates the submitted values against the manifest’s form schema, then invokes the plugin’s storefront:action hook in the sandbox. Raw plugin errors are not echoed to the shopper.

Limits

  • Request bodies are capped while streaming.
  • UI responses are private.
  • Only active, approved, non-yanked installations render.
  • Blocks that fail validation are omitted rather than rendered partially.

Type to search…

↑↓ navigate↵ selectEsc close