Doppler Integration
Doppler is used for managing all environment variables across the Sprout platform.
Overview
All environment variables are managed through Doppler. The project uses the "dev" environment and does not use .env files.
Setup
Install Doppler CLI
# macOS
brew install doppler
# Or using npm
npm install -g doppler-cli
Authenticate
doppler login
Setup Project
# Navigate to project directory
cd /Users/stef/apps/sprout/<repo>
# Setup Doppler (you'll need the project token)
doppler setup
Usage
Running Commands with Doppler
All commands that require environment variables should use doppler run:
# Development server
doppler run -- bun run start:dev
# Database migrations
doppler run -- npx prisma migrate dev
# CLI commands
doppler run -- bun run cli:dev -- command-name
Viewing Secrets
# List all secrets
doppler secrets
# Get specific secret
doppler secrets get DATABASE_URL
# Download secrets as .env (for local testing only)
doppler secrets download --no-file --format env
Environment Management
Environments
The project uses different environments:
- dev - Development environment
- staging - Staging environment (if configured)
- prod - Production environment
Switching Environments
# Switch to dev
doppler setup --config dev
# Switch to prod
doppler setup --config prod
Security Best Practices
- Never commit secrets - All secrets are in Doppler
- Use different secrets per environment - Dev, staging, and prod should have separate secrets
- Rotate secrets regularly - Update API keys and tokens periodically
- Limit access - Only grant access to necessary team members
- Audit access - Regularly review who has access to secrets
Integration with Services
sprout_backend
All environment variables are loaded from Doppler:
- Database connection strings
- API keys
- Service URLs
- Monitoring configuration
sprout_etl
Similar to sprout_backend, all variables from Doppler:
- ETL-specific configuration
- External API keys
- Playwright server URL
Other Services
All repositories that need environment variables should use Doppler.
Troubleshooting
Authentication Issues
# Re-authenticate
doppler login
# Verify setup
doppler setup
Missing Variables
Check that variables are set in Doppler:
doppler secrets get VARIABLE_NAME
Wrong Environment
Verify you're using the correct environment:
doppler setup
References
- Environment Variables - Complete variable reference
- Environment Setup - Setup guide
- Doppler Documentation