Browse documentation

Build & ship

Environments & variables

Keep production, previews, and custom environments configured for the right job.

On this page

Choose a scope

EnvironmentPurpose
ProductionYour production-branch configuration.
PreviewConfiguration shared by preview deployments.
Custom environmentA named environment tied to a branch, such as staging on develop.

Variables belong to the selected scope. Do not assume that a production variable is inherited by preview or a custom environment. Databases are also separate per environment; preview deployments share the preview database.

Add environment variables

  1. Open the project’s Settings → Environment Variables.
  2. Select the environment you want to configure.
  3. Add the key and value, then save.
  4. Create a new deployment in that environment.

Deployed applications keep their captured configuration. Editing a variable does not update an already running deployment. Promotion also keeps the deployment’s original configuration.

Keep secrets on the server.

Build commands can access environment variables. Frameworks may embed variables in browser bundles, especially public-prefixed variables. Never expose database passwords or API secrets through client-side code.

Pass variables to standalone functions

Standalone function routes must explicitly list each variable they need in their manifest’s env array. Keys are case-sensitive. Omitting env or using an empty array passes no project variables.

{
  "path": "/api/data",
  "entrypoint": "data.cjs",
  "env": ["DATABASE_URL", "SERVICE_TOKEN"]
}

This is a route entry inside arvumi-functions.json. See the complete function example. Managed database access also requires DATABASE_URL in the allowlist.

Create a custom environment

Use a branch and an available subdomain for a persistent staging environment. With the CLI linked to your project:

arvumi environments create \
  --name staging \
  --branch develop \
  --subdomain staging-your-project

arvumi environments list

This creates the environment at staging-your-project.arvumi.com. Deploy the matching branch, then use the environment’s UUID when setting variables with the CLI.

Set a variable from the terminal

arvumi env --environment production set LOG_LEVEL info
arvumi env --environment production list
arvumi env --environment preview set LOG_LEVEL debug

These examples assume a linked project. Add --project PROJECT_UUID before the subcommand to choose one explicitly. Use the dashboard for secret values to avoid putting them in shell history. Treat CLI variable output as sensitive.