Skip to content
Sellzy

Domains and CORS

Connect your domains and let the API accept requests from them.

A typical layout:

App Domain
Storefront yourstore.com
Admin admin.yourstore.com
API api.yourstore.com

DNS

Add each domain in its host’s dashboard (Vercel Settings → Domains, Render Settings → Custom Domains, and so on). The host shows the record to create at your domain registrar, usually a CNAME to the host for a subdomain, or an A record for the root domain.

CORS

With NODE_ENV=production, the API only accepts browser requests from:

  • CLIENT_URL and ADMIN_URL
  • PRODUCTION_CLIENT_URL and PRODUCTION_ADMIN_URL
  • localhost

Set them to the exact addresses in the browser bar: scheme and host, no trailing slash.

PRODUCTION_CLIENT_URL=https://yourstore.com
PRODUCTION_ADMIN_URL=https://admin.yourstore.com

Restart the API after changing them.

Everything else that needs the domains

  • Storefront: NEXT_PUBLIC_API_URL, NEXT_PUBLIC_SITE_URL
  • Admin: VITE_NEXT_PUBLIC_API_URL
  • Firebase: add both domains to Authentication → Settings → Authorized domains
  • Stripe: the webhook URL https://api.yourstore.com/api/payments/webhook

Warning

If it works locally but the live site shows CORS errors, the production URLs don’t match the browser address exactly. https://www.yourstore.com and https://yourstore.com are different sites.

Stuck? Run pnpm check:setup, check Troubleshooting, or contact support.