DocsGetting StartedEnvironment Variables

Getting Started

Environment Variables

Securely store API keys and configuration using Secrets.

Environment Variables & Secrets

Never hardcode API keys or passwords in your source code. Syvera provides a Secrets manager for storing sensitive values securely.

Adding a secret

  1. Open the Secrets panel from the left sidebar (lock icon)
  2. Click + New secret
  3. Enter a key (e.g. OPENAI_API_KEY) and a value
  4. Click Add secret

Your secret is now available as an environment variable in your Repl.

Accessing secrets in code

Node.js / JavaScript

js
const apiKey = process.env.OPENAI_API_KEY;

Python

python
import os
api_key = os.environ.get("OPENAI_API_KEY")

Special environment variables

Syvera automatically injects several variables into every Repl:

VariableDescription
REPL_IDUnique identifier for this Repl
REPL_SLUGURL-safe name of the Repl
REPL_OWNERUsername of the Repl owner
DATABASE_URLConnection string (if a database is attached)
PORTPort your server should listen on

Secrets in deployments

Secrets from development are not automatically available in deployments. You must add them separately:

  1. Go to Deploy → Secrets
  2. Add each secret your production app needs

This separation ensures you can use different values for dev and prod.