CoreMVP

Configure Environment

View as Markdown

Configure your local app, Supabase, database, and email here. Add payment settings from the Stripe or Polar environment reference.

Local environment

Run ./coremvp env sync after local Supabase starts. The CLI writes the local app URL, Supabase URL, publishable key, secret key, and database connection to . Do not copy those values from another checkout or maintain them by hand.

For a concurrent checkout, first configure its separate project, ports and app origin through Run another project in Run Locally. Export COREMVP_WEB_PORT before env sync so the generated app origin matches the port where Next.js is listening.

Local OAuth is optional and has a separate startup prerequisite. To test Google, follow Configure OAuth Providers before starting Supabase. env sync derives app connection values; it does not configure OAuth providers or supply their client credentials.

Inspect redacted env

Check redacted env presence with:

./coremvp env list

Use this command for troubleshooting because it reports set or missing without printing secret values.

Key presence does not prove connectivity. Start your app and follow the local Auth checks to check the running application.

Local env example

Keep the app, Supabase, and database values written by env sync. This example shows the shared settings; configure billing separately below.

.env.local
# App origin
NEXT_PUBLIC_APP_URL=http://localhost:3000

# Supabase Auth and database
NEXT_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=...
SUPABASE_SECRET_KEY=...
DATABASE_URL=postgresql://postgres:<password>@127.0.0.1:54322/postgres

# Email delivery
EMAIL_DELIVERY_MODE=mock

# Optional: protected email capture tests
# TEST_EMAIL_CAPTURE_TOKEN=... # only for test_capture

# Optional: real email delivery
# RESEND_API_KEY=... # only for real email
# [email protected] # only for real email

Local variables

App and Supabase

VariableRequired locallyRuntimeDescription
NEXT_PUBLIC_APP_URLYesBrowser/serverLocal app origin, usually http://localhost:3000.
NEXT_PUBLIC_SUPABASE_URLYesBrowser/serverLocal Supabase API URL from bunx supabase status.
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEYYesBrowser/serverLocal Supabase publishable key generated by ./coremvp env sync.
SUPABASE_SECRET_KEYYes (generated)Server onlyLocal Supabase secret key generated by ./coremvp env sync; never expose it to browser code.
DATABASE_URLYesServer onlyLocal Supabase Postgres connection string.

Email delivery

VariableRequired locallyRuntimeDescription
EMAIL_DELIVERY_MODENoServer onlyUse mock for the normal local path. Use real only when you intentionally want local code to send real email. See Email Testing.
TEST_EMAIL_CAPTURE_TOKENTest capture onlyServer onlySecret token for protected local or hosted capture lookup.
RESEND_API_KEYReal email onlyServer onlyResend API key when EMAIL_DELIVERY_MODE=real; this sends real email even locally.
RESEND_FROM_EMAILReal email onlyServer onlySender address when EMAIL_DELIVERY_MODE=real.

Add billing settings

Choose your provider's guide for credentials, catalog IDs, webhook secrets, payment mode, and restart or build requirements:

Production environment

Preview and Production use the same variable names with environment-specific values. See Hosted Environment Variables for the shared copyable block and hosted requirements.

Security rules

RuleReason
Never commit or These files contain secrets.
Never expose server keys as NEXT_PUBLIC_*Browser bundles can read public variables.
Do not print setup links or secret valuesKeeps test artifacts safe for sharing.

What's next

Was this page helpful?

On this page