Adding a Secret
- Open your project and go to Settings > Secrets
- Enter a key (e.g.
STRIPE_SECRET_KEY) and a value - Click Add Secret
Using Secrets in Code
Access your secrets through environment variables:Vite-based projects require the
VITE_ prefix for environment variables that need to be available in the browser. Server-side variables (used in API routes or Edge Functions) do not need the prefix.Managing Secrets
- View: The dashboard shows which secrets exist, but never displays their values
- Update: Add a secret with the same key to overwrite the previous value
- Delete: Remove secrets you no longer need from the settings panel
Best Practices
- Never hardcode secrets in your source code. Always use environment variables.
- Use descriptive key names like
SUPABASE_URLorOPENAI_API_KEYso they are easy to identify. - Keep secrets minimal. Only store what your project actually needs.
- Rotate keys regularly if a service supports it. Update the secret in Aurora and restart your container.