Skip to content

Storefront

How EdgeCart bootstraps a storefront — store profile, publishable key, region, locales, and read models.

The Storefront module provides the public configuration and read models a storefront needs before it can talk to the keyed APIs. It is what makes the first page load possible without embedding an API key in the build.

Features

  • Key-free bootstrap — resolve the deployment’s active store and return the public configuration.
  • Store profile — name, handle, description, and logo for the storefront shell.
  • Default region and currency — the market context used before a shopper chooses a region.
  • Locales — the configured locale codes; an empty list disables the switcher.
  • Publishable key provisioning — returns the store’s publishable key, and creates one for legacy stores on first load.
  • Storefront read models — the product, category, and collection data the storefront renders.

Key concepts

Concept What it means
Storefront config The public bootstrap payload: store profile, default region, currency, locales, and publishable key.
Publishable key A public key (pk_...) safe to send to browsers. It is not a secret.
Default region The region used when the shopper has not selected one.
Locale A language/region code such as en-US. Multiple locales enable the switcher.
Read model A storefront-shaped view of catalog data, not the admin record.

How it fits

  • Storefront shell — loads /api/storefront-config before rendering. The response supplies the store name, logo, default currency, locales, and publishable key.
  • Store API — subsequent storefront requests send the publishable key in x-publishable-api-key.
  • Sales — supplies the store profile, regions, and locales.
  • Catalog — supplies the read models for product, category, and collection pages.
  • Cart — uses the storefront context for pricing and totals.
  • Plugins — storefront plugin slots render inside the storefront shell; plugin assets are served by the separate assets Worker.

Common tasks

  • Merchant — the storefront uses the name, logo, description, and locale data from Store settings. The shell is fixed; there is no theme editor.
  • Developer — start with the GET /api/storefront-config operation in the API reference, and read API conventions for the publishable key header.

Current boundaries

  • The storefront is a fixed Tailwind/shadcn shell. There is no theme editor or custom CSS surface for merchants.
  • The locale switcher appears only when additional locale rows exist; there is no admin page for adding or removing them yet.
  • Storefront search applies translations after matching base fields, so a translated-only query does not find a product yet.

See current limitations for the full list.

  • Sales — store profile, regions, and tax context.
  • Catalog — product read models.
  • Cart — storefront cart and totals.
  • Orders — checkout and order lookup.

Type to search…

↑↓ navigate↵ selectEsc close