DocsDeploymentEnvironment Variables

Environment Variables

Securely manage secrets and configuration for your deployments.

Setting Environment Variables

  1. Go to Project Settings → Environment Variables.
  2. Click "Add Variable".
  3. Enter the key and value.
  4. Choose the environment (Development, Preview, Production).

Accessing Variables in Code

Environment variables are available via process.env in Node.js or the appropriate method for your language.

const apiKey = process.env.API_KEY;

Security

  • Variables are encrypted at rest.
  • They are never exposed in client-side code unless prefixed with NEXT_PUBLIC_ (for Next.js) or similar framework conventions.
  • You can mark variables as "sensitive" to hide them in the UI.

Common Use Cases

  • API keys (Stripe, Twilio, etc.)
  • Database connection strings
  • Feature flags
  • Third-party service credentials