Skip to main content
Secrets let you store API keys, database URLs, and other sensitive configuration for your projects. They are encrypted at rest and injected into your project’s runtime environment automatically.

Adding a Secret

  1. Open your project. Click the project name above the chat, then click Project settings.
  2. Open Secrets.
  3. Enter a key, for example STRIPE_SECRET_KEY, and a value.
  4. Click the + button.
Aurora encrypts and stores the secret. With Auto-sync on, Aurora restarts the preview so the project can read the secret as an environment variable.

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_URL or OPENAI_API_KEY so 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 with process.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.

How It Works

Secrets are encrypted before being stored and only decrypted server-side when your container starts. They are injected directly into the runtime environment and are never sent to the browser or included in your project’s source code.
If you use the VITE_ prefix, the value will be bundled into your frontend code and visible to anyone who inspects your site. Only use VITE_ for values that are safe to expose publicly (like a Supabase anon key). Keep truly sensitive keys server-side only.