Adding a Secret
- Open your project. Click the project name above the chat, then click Project settings.
- Open Secrets.
- Enter a key, for example
STRIPE_SECRET_KEY, and a value. - Click the + button.
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 server functions and API routes) do not need the prefix.Managing Secrets
- View: The dashboard shows which secrets exist, but never displays their values
- Update: Click Update on the secret and enter the new 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, then deploy again.
Secrets in Production
When you deploy, Aurora sends all of the project’s secrets to the production deploy. Server code reads them withprocess.env.NAME, the same as in your preview.
A secret change reaches production only on the next deploy. After you add, update, or delete a secret, deploy the project again.