Environment Variables

Required and optional environment variables for Vercel Shop.

Required

VariableDescription
SHOPIFY_STORE_DOMAINYour Shopify store domain, e.g. your-store.myshopify.com. Found in Settings → Domains in your Shopify admin.
SHOPIFY_STOREFRONT_ACCESS_TOKENPublic Storefront API access token. Found in Settings → Apps and sales channels → Headless.
NEXT_PUBLIC_SITE_NAMEThe storefront's display name. Used in the nav logo, footer copyright, About page, page titles, SEO metadata, and the AI agent's system prompt. Falls back to "Vercel Shop" if unset.

Feature flags

Both optional features are opt-in via explicit NEXT_PUBLIC_ENABLE_* flags. The NEXT_PUBLIC_ prefix is required so the conditional rendering matches between server and client under cache components.

VariableDescription
NEXT_PUBLIC_ENABLE_AUTHSet to "1" to enable the auth UI and the /account/* routes. Requires the three Customer Authentication secrets below — next.config.ts throws at build time if any are missing.
NEXT_PUBLIC_ENABLE_AGENTSet to "1" to enable the AI shopping assistant button and the /api/chat route.

Customer Authentication

Required when NEXT_PUBLIC_ENABLE_AUTH="1". Powers built-in customer authentication via better-auth and Shopify Customer Account API OIDC.

VariableDescription
BETTER_AUTH_SECRETSecret for signing sessions. Generate with openssl rand -base64 32.
SHOPIFY_CUSTOMER_CLIENT_IDCustomer Account API client ID. Found in Shopify Admin → Settings → Customer accounts → API clients.
SHOPIFY_CUSTOMER_CLIENT_SECRETCustomer Account API client secret. Found in the same location as the client ID.

Optional

VariableDescription
BETTER_AUTH_BASE_URLOverride the base URL for auth callbacks. Defaults to NEXT_PUBLIC_BASE_URL or the Vercel production URL.
BETTER_AUTH_TRUSTED_ORIGINSComma-separated list of trusted origins for auth callbacks.
CMS_DRAFT_MODE_SECRETSecret token guarding the /api/draft route for CMS preview links. Generate with openssl rand -base64 32.
DEBUG_SHOPIFYSet to true to log every Shopify Storefront API request and response in the server console.
NEXT_PUBLIC_BASE_URLAbsolute base URL used for sitemap entries, OG tags, and auth callbacks. Defaults to https://${VERCEL_PROJECT_PRODUCTION_URL} on Vercel.
SHOPIFY_WEBHOOK_SECRETShared secret used to verify HMAC signatures on incoming Shopify webhooks at /api/webhooks/shopify.

System variables auto-injected on Vercel that the build reads (VERCEL_PROJECT_PRODUCTION_URL, NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL, V0_CALLBACK_URL) are listed in turbo.json globalEnv so Turbo's strict-mode build sees them. You don't set these yourself.

Chat

Tip: You can open and close chat with I

0 / 1000