Environment Variables
Complete reference for all environment variables used by ReResell.
Required Variables
These variables must be set for the application to work.
DATABASE_URL
PostgreSQL connection string.
Format: postgresql://USER:PASSWORD@HOST:PORT/DATABASE?sslmode=require
Providers:
- Neon (recommended)
- Supabase
- PlanetScale
- Any PostgreSQL provider
NEXTAUTH_URL
The canonical URL of your application.
# Development
NEXTAUTH_URL="http://localhost:3000"
# Production
NEXTAUTH_URL="https://your-domain.com"
Important
Must match your deployed URL exactly, including protocol (https).
NEXTAUTH_SECRET
Secret key for encrypting tokens and cookies.
Generate a secure secret:
Optional Variables
Google OAuth
Enable "Sign in with Google" functionality.
Setup:
- Go to Google Cloud Console
- Create OAuth 2.0 credentials
- Add authorized redirect URIs:
http://localhost:3000/api/auth/callback/googlehttps://your-domain.com/api/auth/callback/google
Vercel Blob Storage
Enable image uploads.
Setup:
- Create a Blob store in Vercel dashboard
- Copy the read/write token
Pusher (Real-time Chat)
Enable real-time messaging features.
# Server-side
PUSHER_APP_ID="1234567"
PUSHER_KEY="abcdefghijk"
PUSHER_SECRET="xxxxxxxxxxxxx"
PUSHER_CLUSTER="us2"
# Client-side (exposed to browser)
NEXT_PUBLIC_PUSHER_KEY="abcdefghijk"
NEXT_PUBLIC_PUSHER_CLUSTER="us2"
Setup:
- Create account at Pusher
- Create a Channels app
- Copy credentials from App Keys
Environment by Platform
Local Development
Create a .env file in the project root:
DATABASE_URL="postgresql://..."
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="development-secret"
Netlify
Add variables in Site settings → Environment variables.
Vercel
Add variables in Project Settings → Environment Variables.
Docker
Pass variables via docker run -e or docker-compose.yml:
environment:
- DATABASE_URL=${DATABASE_URL}
- NEXTAUTH_URL=${NEXTAUTH_URL}
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
Security Best Practices
- Never commit
.envfiles to version control - Use different secrets for development and production
- Rotate secrets periodically
- Limit access to production environment variables
- Use secret managers for sensitive data in production