Skip to main content
Unkey Deploy is currently in private beta. To get access, reach out on Discord or email support@unkey.com.
Variables are encrypted key-value pairs that Unkey injects into your application as environment variables at runtime. Each variable is scoped to a specific environment, so production and preview can have different values.

Create variables

  1. Open your project’s Settings tab.
  2. Select the environment (production or preview).
  3. Under Environment variables, click Add variable.
  4. Enter the key and value.
  5. Choose the visibility type.
  6. Save the changes.
You can also paste multiple variables in bulk or drag and drop a .env file.

Visibility types

Each variable has a visibility type that controls whether the value can be read back after saving:
TypeDescription
RecoverableThe value can be viewed in the dashboard after saving
Write-onlyThe value is hidden after saving and cannot be retrieved from the dashboard
Use write-only for secrets like API keys, database passwords, and tokens. Use recoverable for non-sensitive configuration like feature flags, service URLs, and port numbers.
All variables are encrypted at rest regardless of visibility type. The distinction only affects whether the value is displayed in the dashboard.

Environment scoping

Variables are tied to a specific environment. This lets you use different configuration for production and preview without managing separate config files:
VariableProductionPreview
DATABASE_URLpostgres://prod-db.acme.com/apipostgres://dev-db.acme.com/api
LOG_LEVELwarndebug
FEATURE_V2_UIfalsetrue

Variables and deployments

Deployments are immutable. Variable changes don’t affect running deployments. To apply updated variables, trigger a new deployment. This means you can update variables safely without worrying about side effects on running instances. The new values only take effect when the next deployment starts.

Next steps

Environments

How environments isolate configuration and deployments

App settings

Full reference for build, runtime, and variable settings
Last modified on March 30, 2026