Environment

Getting StartedEnvironment setupValidation-ready

Environment variables are validated in src/env.js with @t3-oss/env-nextjs and Zod.

This page shows which variables are required, which ones are optional, and what each integration expects before the app can run correctly in development or production.

Recommended workflow

Complete your environment values before running database setup, auth flows, email delivery, or payment tests. It avoids false errors caused by incomplete configuration.

Variable reference

Required server variables

VariablePropósito
AUTH_SECRETSecret used by NextAuth
DATABASE_URLPostgreSQL connection string
RESEND_API_KEYResend API access for transactional email
GOOGLE_CLIENT_IDGoogle OAuth client ID
GOOGLE_CLIENT_SECRETGoogle OAuth client secret
STRIPE_SECRET_KEYStripe server API key
STRIPE_PUBLISHABLE_KEYStripe publishable key
STRIPE_WEBHOOK_SECRETSignature secret for the Stripe webhook route
STRIPE_PRICE_BASIC_IDStripe price ID for the BASIC tier
STRIPE_PRICE_PRO_IDStripe price ID for the PRO tier
STRIPE_PRICE_ENTERPRISE_IDStripe price ID for the ENTERPRISE tier
STRIPE_PRICE_ONE_TIME_IDStripe price ID for one-time checkout

Optional server variables

VariablePropósito
STRIPE_COUPON_BASICOptional coupon applied to the BASIC plan
STRIPE_COUPON_PROOptional coupon applied to the PRO plan

Required client variables

VariablePropósito
NEXT_PUBLIC_APP_URLBase URL used for app links and checkout redirects
Integration notes

Notes by integration

Auth

  • AUTH_SECRET is required in production.
  • Google OAuth is enabled in the current auth configuration.

Stripe

  • Create all prices first in Stripe and store their IDs in the .env file.
  • The webhook route expects the signing secret from your Stripe endpoint configuration.

Resend

  • The sender address is configured in src/config/site.ts as resendEmail.
  • That address must belong to a verified domain in your Resend account.

Keep values consistent

If you change provider settings in your environment file, make sure the related defaults in your config and integration files still match those choices.

Validation

Validation behavior

  • Empty strings are treated as missing values.
  • Validation can be skipped with SKIP_ENV_VALIDATION, which is usually only useful in controlled build contexts.