Skip to content

Environment Variables

RocketFuel applications use environment variables for configuration. This guide covers all available variables and how to set them up.

Getting Started

After creating a project, copy the example environment file:

Terminal window
cp .env.example .env

Core Variables

Database

VariableRequiredDescription
DATABASE_URLYesPostgreSQL connection string

Example:

Terminal window
DATABASE_URL="postgresql://user:password@localhost:5432/myapp"

Authentication Variables

Required when Clerk is enabled:

VariableRequiredDescription
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYYesPublishable key from Clerk dashboard (client-safe)
CLERK_SECRET_KEYYesSecret key from Clerk dashboard
CLERK_WEBHOOK_SECRETYesWebhook signing secret for user sync
NEXT_PUBLIC_CLERK_SIGN_IN_URLYesPath to sign-in page
NEXT_PUBLIC_CLERK_SIGN_UP_URLYesPath to sign-up page

Example:

Terminal window
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_test_..."
CLERK_SECRET_KEY="sk_test_..."
CLERK_WEBHOOK_SECRET="whsec_..."
NEXT_PUBLIC_CLERK_SIGN_IN_URL="/sign-in"
NEXT_PUBLIC_CLERK_SIGN_UP_URL="/sign-up"

Stripe Variables

Required when Stripe is enabled:

VariableRequiredDescription
STRIPE_SECRET_KEYYesSecret key from Stripe dashboard
STRIPE_WEBHOOK_SECRETYesWebhook signing secret
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYYesPublishable key (client-safe)

Queue Variables

Required when BullMQ is enabled:

VariableRequiredDescription
REDIS_URLYesRedis connection string

Example:

Terminal window
REDIS_URL="redis://localhost:6379"

Email Variables

Required when Resend is enabled:

VariableRequiredDescription
RESEND_API_KEYYesAPI key from Resend dashboard

Environment-Specific Configuration

Development

Use local services and test credentials:

Terminal window
DATABASE_URL="postgresql://postgres:password@localhost:5432/myapp_dev"
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_test_..."
CLERK_SECRET_KEY="sk_test_..."

Production

Use production services and secure credentials:

Terminal window
DATABASE_URL="postgresql://user:password@prod-db.example.com:5432/myapp"
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_live_..."
CLERK_SECRET_KEY="sk_live_..."