Skip to content
Tulos

Environment variables

Every setting in .env, what it does and where to find it.

Copy .env.example to .env and fill it in. Restart pnpm dev after every change.

cp .env.example .env
Variable Required What it is
NEXT_PUBLIC_BASE_URL yes Your store URL. http://localhost:3000 locally
NEXT_PUBLIC_SANITY_PROJECT_ID yes Sanity project ID
NEXT_PUBLIC_SANITY_DATASET yes Usually production
NEXT_PUBLIC_SANITY_API_VERSION no Defaults to 2025-01-01 in .env.example
SANITY_API_TOKEN yes Editor token (server only)
SANITY_API_READ_TOKEN yes Viewer token for live content and previews
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY yes Clerk publishable key
CLERK_SECRET_KEY yes Clerk secret key (server only)
NEXT_PUBLIC_CLERK_SIGN_IN_URL yes /auth/signin
NEXT_PUBLIC_CLERK_SIGN_UP_URL yes /auth/signup
STRIPE_SECRET_KEY yes Stripe secret key (server only)
STRIPE_WEBHOOK_SECRET yes Webhook signing secret
ADMIN_EMAIL yes Comma-separated admin emails
NEXT_PUBLIC_ADSENSE_CLIENT_ID no AdSense publisher ID; empty means no ads

Warning

Never commit .env. It is in .gitignore. Variables that start with NEXT_PUBLIC_ are sent to the browser, so never put a secret in one.

Where each value comes from