api.apps.envs. Every method takes the app id first and returns the app’s variables as a plain Record<string, string>.
Examples use the api client from Creating the client. appId is the id of one of your apps: api.account.me() lists them.
Static apps have no environment variables: every method answers 400
STATIC_APP_ENV_NOT_SUPPORTED. A change takes effect on the next restart.Reading the variables
Adding or updating variables
envs.set(appId, envs) adds the given keys and overwrites the ones that already exist. Other variables are kept. It returns every variable after the change.
Replacing every variable
envs.replace(appId, envs) replaces all variables with the given set. Keys not in the object are removed.
Removing variables
envs.delete(appId, keys) removes the given keys and returns the remaining variables.
Limits and errors
Next steps
Deploys
Deploy on every push, with a webhook or the GitHub App.
Environment variables API reference
The REST endpoints behind these methods.
Variables from the CLI
The same actions from the terminal.
Read variables in your code
Set variables from the dashboard, CLI or API and read them at runtime.

