Skip to main content

Customer Account Extensions

Customer-account extensions are iframes injected into the customer’s account pages (/account, /orders/[orderId], /account/profile). Use them for order tracking widgets, loyalty balances, support chat panels, and similar customer-facing surfaces. These are distinct from admin extensions (which target the merchant admin UI) and from checkout extensions (which target the unauthenticated checkout flow). They run for a logged-in customer with the customer’s session.

Targets

All four targets have a slot mounted in the storefront account pages. dashboard.block.render renders above the page header on /account; order-list.block.render renders between the header and the order history list on the same page; profile.block.render renders above the “Profile” heading on /account/profile; order-status.block.render renders on the per-order page. The <CustomerAccountExtensionSlot target="..." /> component renders one iframe per registered extension at the given target. It requires the customer’s session token as bearerToken; without it the slot API returns 401 and the slot renders empty (correct secure default — extension enumeration is gated behind authentication).

Manifest

Where the entry goes. In the app.json manifest, list it under extensions.customerAccountExtensions[] (the type key is not needed there). From the developer portal / API (POST /apps/developer/:appId/extensions), send type: "customer_account_extension" with url — or upload an .html file instead of a url. Both land in the same list and render on every store that has the app installed. An entry whose target is not one of the targets above, or that has neither a url nor an .html file, is rejected with HTTP 400.

How the iframe is rendered

Each registered extension is rendered as a plain iframe pointed at its resolved url:
A few things to design around:
  • No App Bridge host on this surface. Unlike admin extensions, the customer-account slot does not run an App Bridge postMessage host — there is no useApi() / EXTENSION_CONTEXT wiring on the storefront side. The one message it listens for is APP_BRIDGE_RESIZE (below).
  • Page context comes as query params. Every iframe receives target, domainSlug and extensionId; the order-status block additionally gets orderId (the order being viewed).
  • Identity is not passed. The host never hands the customer’s session to the iframe. To know who is looking, serve the block through the App Proxy — use a relative url such as /apps/<your-subpath>/account/order-status: it resolves against the storefront origin, so the request carries the shopper’s session and your server receives a signed logged_in_customer_id.
  • Resize. The frame starts at 120px. Post { type: 'APP_BRIDGE_RESIZE', extensionId: <the extensionId you were given>, height } to window.parent and the host resizes it (40–4000px).
  • Navigation. allow-top-navigation-by-user-activation lets a block link the shopper to a full-page surface (<a href="/apps/…/portal" target="_top">) on a click — never on load.
  • Both account modes. Stores that render their account pages from the theme’s templates/customers/* get the same iframes injected at the end of the page’s <main>; native (React) account pages render them in place.

Discovery

The storefront exposes:
which returns the registered extensions plus their absolutized URLs. The slot component fetches this on mount and renders one iframe per extension. The storefront route resolves extensions from two sources and merges them: Behind the storefront route, the platform resolves the first source via:
This endpoint authenticates as the customer (not the merchant) and only returns extensions belonging to apps that are actively installed on that store and not suspended. A merchant admin token is rejected.
Extensions registered through the dev portal now render. Earlier builds had no backend resolver for this category, so only on-disk manifests were ever returned and portal-registered customer-account extensions stayed invisible with no error. If you registered one previously and never saw it, no manifest change is required — it resolves on its own.

Security

  • The iframe is sandboxed with allow-scripts allow-forms allow-popups allow-top-navigation-by-user-activation and no allow-same-origin, so it runs in an opaque origin and cannot read the parent page’s cookies or storage. (The iframe document request is still made by the parent’s browsing context, so a same-site relative url reaches the App Proxy with the shopper’s session cookie — that is the supported way to learn who is viewing; the block’s own fetch calls run from the opaque origin and carry no cookies.)
  • Enumerating a store’s installed extensions is gated behind authentication: the discovery endpoint requires the customer’s bearer token and returns 401 without it (the slot then renders nothing). The token is validated by the platform on every call — a non-OK result yields no extensions rather than falling back to the on-disk manifests.
  • The bearer token the slot is mounted with is the customer’s session credential. If your iframe needs to call an API on behalf of the customer, your own backend must independently verify that credential — never trust ids passed to you in the clear.