Environment Setup
Configure service credentials and environment variables for local development.
Environment variables separate sensitive credentials from source code. The configuration connects StarterApp to authentication providers, database services, and billing infrastructure.
Development vs Production
Development uses placeholder values and localhost URLs. Production requires real service credentials and HTTPS domains. The .env.local
file is gitignored to prevent credential leaks.
Initial Configuration
Create the local environment file from the template:
cp .env.example .env.local
The .env.local
file stores credentials outside version control. Each developer maintains individual configuration values.
Required Variables
Core services require configuration before the application starts:
Billing Configuration
UseAutumn Integration
Billing features require API credentials and configuration synchronization. Configure UseAutumn before syncing to Convex:
Create account at UseAutumn ↗ and obtain secret key from Settings > API Keys
Add the secret key to .env.local
:
AUTUMN_SECRET_KEY=am_sk_your_key_here
Edit autumn.config.ts
to define products, features, and pricing tiers matching the business model
Synchronize configuration to UseAutumn:
npx atmn push
Billing operations fail until configuration synchronization completes. Rerun npx atmn push
after modifying products or features in autumn.config.ts
.
Convex Environment Sync
Convex functions run in managed infrastructure requiring separate environment configuration. The sync process requires AUTUMN_SECRET_KEY
to be configured first. Sync credentials to Convex deployment using the automated script or manual commands:
Production Configuration
Configure production environment variables through the Convex Dashboard ↗. Navigate to Settings > Environment Variables to set production credentials directly in the web interface.
Optional Services
Additional integrations for analytics and security:
Environment Variables Reference
Complete variable listing organized by service:
Validation
Verify configuration by starting the development server:
pnpm dev
Successful startup confirms proper environment configuration. The terminal displays application URLs:
- Marketing:
http://localhost:3000
- Dashboard:
http://localhost:3001
- Docs:
http://localhost:3100
Common Configuration Errors
Security Best Practices
Environment variable management follows security principles:
- Files with
.local
suffix are gitignored automatically - Production credentials remain separate from development values
- Secrets rotate independently per environment
- No credentials appear in source code or commit history
- Team members maintain individual development configurations
Next Steps
After environment configuration:
AI Onboarding
Complete automated setup with AI-guided dependency installation and first boot.
Platform Setup
Install Node.js, pnpm, and development tools for your operating system.
Authentication
Configure OAuth providers, session management, and protected routes.
Billing
Set up UseAutumn integration, feature gates, and subscription tiers.