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 Better Auth is enabled:

VariableRequiredDescription
BETTER_AUTH_SECRETYesSecret key for signing tokens
BETTER_AUTH_URLYesBase URL of your application

Generate a secure secret:

Terminal window
openssl rand -base64 32

Example:

Terminal window
BETTER_AUTH_SECRET="your-generated-secret-here"
BETTER_AUTH_URL="http://localhost:3000"

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"
BETTER_AUTH_URL="http://localhost:3000"

Production

Use production services and secure credentials:

Terminal window
DATABASE_URL="postgresql://user:password@prod-db.example.com:5432/myapp"
BETTER_AUTH_URL="https://myapp.com"