Configuration

Configuration

Check mode, modules, adapters, bindings, and target in nextdevtpl.generated.json, then review the generated .env.example. Full mode always requires the site URL (NEXT_PUBLIC_APP_URL); configure other variables according to the generated selection. Demo mode needs no business environment variables or database.

Demo mode

Demo mode keeps sample state in the current browser tab's memory and does not connect to real services. It needs no .env file, database, auth secret, or provider credentials. Plan prices and entitlements come from the project's shared plan catalog; skin demo data can override only permitted sample fields.

Full-mode base variables

Full mode always requires the site URL NEXT_PUBLIC_APP_URL. Set database, auth, and provider variables only when the generated selection includes the corresponding capability:

VariablePurpose
DATABASE_URLPostgreSQL connection for database features, Drizzle, and health checks
BETTER_AUTH_SECRETSession signing; use a long random production value
BETTER_AUTH_URLSite URL used by Better Auth callbacks and cookies
NEXT_PUBLIC_APP_URLBrowser links, metadata, and return URLs
NEXT_PUBLIC_APP_NAMEDisplay name for the site and email

After creating .env.local, use the generated .env.example as the source of truth. A custom project without database or auth features should not copy requirements from another combination.

Authentication and product

CapabilityVariables
GitHub OAuthGITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET
Google OAuthGOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET
Plan pricesSix NEXT_PUBLIC_PRICE_* IDs for STARTER, PRO, and ULTRA monthly and yearly plans
Credit expiry cronCRON_SECRET
GA4 browser scriptNEXT_PUBLIC_GA_ID
Product analyticsPostHog: POSTHOG_API_KEY, POSTHOG_HOST; GA4: GA4_MEASUREMENT_ID, GA4_API_SECRET; Umami: UMAMI_WEBSITE_ID, UMAMI_API_KEY, UMAMI_HOST
Operations alertsCRON_SECRET, optional thresholds, and selected alert adapter variables
SentryNEXT_PUBLIC_SENTRY_DSN, SENTRY_AUTH_TOKEN
AxiomAXIOM_TOKEN, AXIOM_DATASET

OAuth callbacks are /api/auth/callback/github and /api/auth/callback/google. Production provider settings must use the final domain.

Service adapters

SelectionVariables or bindings
CreemCREEM_API_KEY, CREEM_WEBHOOK_SECRET
StripeSTRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET
S3 CompatibleSTORAGE_ENDPOINT, STORAGE_REGION, STORAGE_BUCKET_NAME, STORAGE_ACCESS_KEY_ID, STORAGE_SECRET_ACCESS_KEY
R2 BindingNEXTDEVTPL_STORAGE
ResendRESEND_API_KEY, EMAIL_FROM
SMTPSMTP_HOST, SMTP_PORT, SMTP_SECURE, optional credentials
Cloudflare EmailNEXTDEVTPL_EMAIL, EMAIL_FROM
OpenAI CompatibleAI_PROVIDER and the selected OpenAI/DeepSeek/MiMo key and model
AnthropicANTHROPIC_API_KEY, ANTHROPIC_MODEL
Workers AIAI binding, WORKERS_AI_MODEL
InngestINNGEST_EVENT_KEY, INNGEST_SIGNING_KEY
Cloudflare WorkflowsNEXTDEVTPL_WORKFLOW
UpstashUPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKEN
Cloudflare rate limitsBindings including RATE_LIMIT_GLOBAL
Alert emailALERT_EMAIL_TO, EMAIL_FROM
Alert webhookALERT_WEBHOOK_URL, optional ALERT_WEBHOOK_SECRET

Operations thresholds are optional: ALERT_COOLDOWN_MINUTES, ALERT_PAYMENT_FAILURE_RATE_THRESHOLD, and ALERT_AI_COST_THRESHOLD_MINOR. Amount thresholds use the smallest unit of the configured currency. The generated alert adapter is fixed with --alerts; ALERT_PROVIDER is used only by the full template source and is not read by a generated project.

Cloudflare bindings and secrets

Cloudflare bindings live in wrangler.jsonc; binding names and resource types must match the selected adapters. Configure secrets with wrangler secret put or the platform secret manager. Never put real secrets in source control or wrangler.jsonc. Full-mode Cloudflare projects use a PostgreSQL-compatible database service; D1 is not currently a generator database option.

Demo mode supports only server and does not generate Cloudflare bindings.

Missing configuration

  • In full mode, missing database or auth variables required by selected features cause startup, health checks, or the corresponding operation to fail.
  • Missing credentials for a selected service produce an explicit configuration error when called.
  • Disabled mail and no-op rate limiting are useful locally but provide no delivery or abuse protection.
  • Local logs and console errors remain available without Axiom or Sentry.
  • Browser analytics respects consent and removes sensitive fields; missing analytics credentials do not block the business request.
  • Demo mode makes no provider calls; profile, plan, and ticket changes do not persist to a server.

Common edit points

PathContent
src/config/site.tsName, URL, metadata, and social links
src/config/nav.tsHeader, footer, dashboard, and admin navigation
src/config/payment.tsFull-mode product IDs and checkout settings
src/core/plans/Plan limits and display data shared by full and demo modes
src/services/*.tsActive adapter instances
.env.localLocal variables and secrets

On this page