Deploying
The starter is a Node server. Any host that runs Node 26 or newer works.
-
Add your production origin to the storefront’s allowed origins in Settings → Custom storefronts, for example
https://shop.example. -
Set the environment variables on the host.
npm startdoesn’t read.env. SetSEVIGRAM_STOREFRONT_TOKENandAPP_ORIGIN=https://shop.example, plusSEVIGRAM_STOREFRONT_PRIVATE_TOKENas a secret if you use it. Don’t set theSEVIGRAM_DEMO_*variables. -
Build and start:
Terminal window npm cinpm run buildnpm startnpm startlistens onPORT, default 3000. Put your host’s HTTPS in front of it. -
Tell the app about your proxy. With a private token, the server forwards each shopper’s IP so rate limits apply per shopper. Behind a load balancer or CDN, either:
- set
TRUST_PROXYto the number of proxies that append toX-Forwarded-For, usually1; or - set
CLIENT_IP_HEADERto the header your platform sets, such ascf-connecting-iporfly-client-ip, withTRUST_PROXY=1.
- set
-
Check it. Run
npx loom check --env <file>against a file with the production values, or open the site and walk through a checkout.
APP_ORIGIN must equal the exact public origin, meaning scheme, host and port, that shoppers use. Otherwise customer sign-in, sign-out and signed-in checkout answer 403.
To try the production build locally, run npm run build, then npm run preview. Preview reads .env and listens on APP_ORIGIN’s port.
Other runtimes
Section titled “Other runtimes”The app code uses no Node built-ins. On a worker runtime without process.env, such as Cloudflare Workers without Node compatibility, change readConfig in app/lib/storefront.server.ts to read your platform’s environment bindings.
Troubleshooting
Section titled “Troubleshooting”- A “Connect your storefront” page. A setting is missing or malformed. The page names each variable and the problem.
network_error. The request never reached the API. Check the network, DNS, firewall andSEVIGRAM_API_BASE_URL.npm run devworks butnpm startdoesn’t.npm startignores.env. Set the variables in the host’s environment.- The demo banner is still shown after connecting.
SEVIGRAM_STOREFRONT_TOKENstill holds the demo token. Replace it and restart the server. - An API error. Every error has a
code; see Requests and errors. The starter’s error page shows the request ID to quote when you contact support.