Storefront environment
In the hosted
cravejs-storefront-template, the controlled host/subdomain
selects the merchant and the [locationId] route selects the location. Do not
duplicate those tenant selectors as production environment variables. The
prefixed merchant and location variables above are only for standalone or local
quickstart wiring. The canonical storefront origin is host-derived from request
headers by default; set NEXT_PUBLIC_STOREFRONT_URL only when deployment
metadata needs an explicit override.
Do not configure private Crave API keys, provider credentials or inbound webhook secrets, cart capabilities, customer JWTs, or receipt capabilities as public variables.
API service environment
Provider credentials remain on the API service. Every browser deployment needs its exact browser origin registered before it sends credentials or capabilities. An origin is the scheme, hostname, and non-default port; paths are not part of an origin. For the Crave-managed API, provide the local-development, stable-preview, and production origins to the Crave integration owner. There is currently no wildcard or arbitrary self-service bypass. Register stable preview origins individually; do not attempt to allow every generated preview hostname. Operators of the API service configure the approved origins as a comma-separated list:https://*.craveup.com origins are allowed by default. Localhost is allowed only outside production. The API accepts Authorization, X-Cart-Token, X-Checkout-Handoff, X-Receipt-Token, Idempotency-Key, If-Match, X-Request-Id, and Content-Type, and exposes ETag plus X-Request-Id. Restart or redeploy the API after changing its static allowlist, then verify the preflight from the exact deployed origin.
Native iOS and Android requests normally omit the browser Origin header. Expo web, embedded web views that send an origin, and browser storefronts still require exact registration.
Vercel or Netlify
- Import the storefront repository.
- Add the public variables for the correct environment.
- Add the deployed origin to the API allowlist before testing cross-origin requests.
- Build and deploy a preview.
- Verify anonymous catalog reads, ordering-session creation, cart mutation, PaymentIntent creation, and terminal order polling.
- Promote the exact verified commit to production.