Configuration

Configuration

Configuration is environment-variable driven. Start with the required variables, then enable optional services as needed.

Required for local boot

VariablePurpose
DATABASE_URLPostgreSQL connection string used by Drizzle and Better Auth
BETTER_AUTH_SECRETSecret used to sign auth/session data
BETTER_AUTH_URLBase URL for Better Auth callbacks and cookies

Example:

DATABASE_URL="postgresql://postgres:password@localhost:5432/nextdevtpl"
BETTER_AUTH_SECRET="replace-with-a-random-secret"
BETTER_AUTH_URL="http://localhost:3000"
ServiceVariablesNotes
GitHub OAuthGITHUB_CLIENT_ID, GITHUB_CLIENT_SECRETCallback: /api/auth/callback/github
Google OAuthGOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRETCallback: /api/auth/callback/google
ResendRESEND_API_KEY, EMAIL_FROMEnables real email verification and reset emails

If email is not configured, test authentication flows that do not require delivery first.

Optional product services

ServiceVariablesUsed by
CreemCREEM_API_KEY, CREEM_WEBHOOK_SECRETSubscription checkout, credit purchases, webhooks
S3/R2STORAGE_ENDPOINT, STORAGE_REGION, STORAGE_BUCKET, STORAGE_ACCESS_KEY_ID, STORAGE_SECRET_ACCESS_KEYFile uploads and proxy routes
Upstash RedisUPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKENAPI and anonymous rate limiting
AxiomAXIOM_TOKEN, AXIOM_DATASETStructured cloud logs
SentryNEXT_PUBLIC_SENTRY_DSN, SENTRY_AUTH_TOKENError capture and release uploads
OpenAI-compatible AIOPENAI_API_KEY, provider-specific base URL/model vars if configuredAI abstraction in src/lib/ai
InngestINNGEST_EVENT_KEY, INNGEST_SIGNING_KEYBackground jobs in production

Degradation model

Optional services should not block a basic local boot. The intended behavior is:

Missing serviceExpected behavior
RedisRate limiter falls back instead of crashing
AxiomLogger writes locally
SentryMonitoring hooks become no-op or console-only
StorageUpload flows are unavailable, app shell still runs
CreemPayment flows are unavailable, non-payment pages still run
Inngest keysLocal development can run without production signing keys

Where configuration lives

PathWhat to edit
src/config/site.tsSite name, URL, metadata, social links
src/config/nav.tsHeader, footer, dashboard, and admin navigation
src/config/payment.tsPayment product and checkout configuration
src/config/subscription-plan.tsPlan limits and pricing display
messages/*.jsonUI copy
.env.localLocal secrets and service credentials

On this page