Environment Variables
Use apps/web/.env.local.example as the tracked contract for the local web app.
Run bun run dev:convex to connect the repo to your hosted Convex dev deployment. That command writes NEXT_PUBLIC_CONVEX_URL and CONVEX_DEPLOYMENT into apps/web/.env.local.
Core public runtime
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: lets the browser talk to ClerkNEXT_PUBLIC_CLERK_SIGN_IN_URL: must stay/sign-inbecause the app uses a custom Clerk sign-in routeNEXT_PUBLIC_CONVEX_URL: lets the browser talk to ConvexNEXT_PUBLIC_CONVEX_SITE_URL: optional but important for Convex HTTP actions like observability ingest and incident status control when the deployment serves browser traffic on.convex.cloudand HTTP actions on.convex.site
Convex CLI target
CONVEX_DEPLOYMENT: written byconvex devintoapps/web/.env.localso repo scripts andconvex runcommands target your hosted Convex dev deployment explicitly
Core server runtime
APP_BASE_URL: canonical app URL for checkout success and cancel redirectsCLERK_AUTHORIZED_PARTIES: optional comma-separated origin allowlist passed to Clerk middleware for subdomain cookie-leak protectionCLERK_SECRET_KEY: server-side Clerk accessCLERK_FRONTEND_API_URL: Clerk frontend API domain used by the auth chainCLERK_WEBHOOK_SIGNING_SECRET: verifies Clerk webhook requests sent to/api/observability/clerkOBSERVABILITY_INGEST_TOKEN: shared random secret used by Next.js to authenticate error-ingest requests into ConvexOBSERVABILITY_INCIDENT_CONTROL_TOKEN: separate bearer token for the maintainer-only incident status route at/api/observability/incidents/[incidentId]/statusOBSERVABILITY_VERCEL_WEBHOOK_SECRET: verifies Vercel deployment webhooks sent to/api/observability/vercelSTRIPE_SECRET_KEY: Stripe API accessSTRIPE_WEBHOOK_SECRET: verifies the Stripe webhookSTRIPE_PRICE_ID: optional dashboard-managed priceSTRIPE_PRODUCT_ID: optional product id emitted by the Stripe script
Telegram observability
TELEGRAM_BOT_TOKEN: Telegram bot token used for production alertsTELEGRAM_CHAT_ID: chat or group id that receives alertsENABLE_OBSERVABILITY_TEST_TRIGGER: test-only switch for the Playwright protected-shell failure harness
OBSERVABILITY_INGEST_TOKEN is not provided by Telegram, Clerk, Stripe, or Convex. It is just a high-entropy shared secret between the Next.js app and the Convex HTTP ingest route. Generate one with openssl rand -hex 32 and set the same value in both runtimes.
In production, NEXT_PUBLIC_CONVEX_URL alone is not enough for the observability system if the deployment’s HTTP actions live on a separate .convex.site origin. Set NEXT_PUBLIC_CONVEX_SITE_URL to the matching .convex.site hostname so /observability/events and /observability/incidents/status reach the real backend.
Optional video pipeline
AUPHONIC_API_KEYAUPHONIC_PRESET_IDBUNNY_STREAM_API_KEYBUNNY_STREAM_LIBRARY_IDVIDEO_PIPELINE_PYTHON_BIN
Optional Codex app-server integration
CODEX_BINARYCODEX_APP_SERVER_ENABLEDCODEX_APP_SERVER_HOME_ROOTCODEX_APP_SERVER_MODELCODEX_APP_SERVER_TIMEOUT_MS
Optional QA helpers
CLERK_TEST_USER_SCOPEQA_COURSE_SLUG
Practical rule
Only set what the current flow actually needs. The app does not require every optional variable on day one.