localhost and locally-trusted certificates (e.g. mkcert + lvh.me) won’t pass domain verification. The simplest way to expose your local storefront with a valid public HTTPS URL is Cloudflare Tunnel.
Setup
-
Install
cloudflared: -
Start the dev server normally (HTTP on port 3001):
-
In a second terminal, expose it through a quick tunnel:
The output will contain a URL like
https://<random-words>.trycloudflare.com. - Register that URL in your Stripe Payment method domains.
- Open the tunnel URL in your browser and test the Express Checkout buttons in the cart.
Stable tunnel URLs
next.config.ts already allows *.trycloudflare.com via allowedDevOrigins, so quick tunnels work out of the box. Every time you restart cloudflared tunnel --url ... you get a new random subdomain — if you need a stable URL (to avoid re-registering in Stripe on each run), set up a named tunnel on your own domain.
The Spree backend must also be publicly reachable
The storefront’s server-side fetches go toSPREE_API_URL, but image URLs and a few other backend-served paths (e.g. the Apple Pay domain-verification file under /.well-known/apple-developer-merchantid-domain-association) are fetched by the browser directly and must resolve from the public internet.
Point SPREE_API_URL at a hosted Spree (e.g. *.spree.sh, *.vendo.dev, your own staging) or expose your local Spree with another tunnel:
.env:

