All sensitive configuration must be stored in environment variables, never hardcoded:
SUPABASE_URL- Your Supabase project URLSUPABASE_ANON_KEY- Supabase anonymous/public keySUPABASE_SERVICE_ROLE_KEY- Supabase service role key (keep secret!)OPENAI_API_KEY- OpenAI API keyDATABASE_URL- PostgreSQL connection string
- Never commit secrets: Ensure
.envfiles are in.gitignore - Use strong keys: All API keys should be generated from official sources
- Rotate keys regularly: Update API keys periodically
- Minimal permissions: Use keys with only necessary permissions
- Environment validation: The application validates all environment variables on startup
-
Copy
.env.exampleto.env:cp .env.example .env
-
Fill in your actual values from:
-
Never share or commit the
.envfile
For production deployments:
- Use environment variable management services (e.g., Vercel env vars, Fly.io secrets)
- Enable audit logging for API key usage
- Implement rate limiting
- Use HTTPS everywhere
- Enable CORS only for trusted origins
If you discover a security vulnerability, please create a private security advisory on GitHub or contact the repository maintainers directly instead of using the public issue tracker.