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:
cp .env.example .envCore Variables
Database
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string |
Example:
DATABASE_URL="postgresql://user:password@localhost:5432/myapp"Authentication Variables
Required when Better Auth is enabled:
| Variable | Required | Description |
|---|---|---|
BETTER_AUTH_SECRET | Yes | Secret key for signing tokens |
BETTER_AUTH_URL | Yes | Base URL of your application |
Generate a secure secret:
openssl rand -base64 32Example:
BETTER_AUTH_SECRET="your-generated-secret-here"BETTER_AUTH_URL="http://localhost:3000"Stripe Variables
Required when Stripe is enabled:
| Variable | Required | Description |
|---|---|---|
STRIPE_SECRET_KEY | Yes | Secret key from Stripe dashboard |
STRIPE_WEBHOOK_SECRET | Yes | Webhook signing secret |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | Yes | Publishable key (client-safe) |
Queue Variables
Required when BullMQ is enabled:
| Variable | Required | Description |
|---|---|---|
REDIS_URL | Yes | Redis connection string |
Example:
REDIS_URL="redis://localhost:6379"Email Variables
Required when Resend is enabled:
| Variable | Required | Description |
|---|---|---|
RESEND_API_KEY | Yes | API key from Resend dashboard |
Environment-Specific Configuration
Development
Use local services and test credentials:
DATABASE_URL="postgresql://postgres:password@localhost:5432/myapp_dev"BETTER_AUTH_URL="http://localhost:3000"Production
Use production services and secure credentials:
DATABASE_URL="postgresql://user:password@prod-db.example.com:5432/myapp"BETTER_AUTH_URL="https://myapp.com"