Skip to main content
Environment variables are modeled as squarecloud.EnvVars, a plain map[string]string. Every method resolves to the full env set after the operation completes — you always get an up-to-date map back.
Limits: up to 256 variables per application, keys up to 1024 characters and values up to 4096 characters.

Listing environment variables

Adding or updating variables

api.SetApplicationEnvs(appID, envs) merges new variables into the existing set. Existing keys not present in the call are preserved.

Replacing the entire env set

api.ReplaceApplicationEnvs(appID, envs) overwrites every variable.
Anything not listed in the call is removed. Use SetApplicationEnvs when you only want to add or update — ReplaceApplicationEnvs deletes every variable you leave out.
Pass an empty map to wipe all variables:

Deleting variables

api.DeleteApplicationEnvs(appID, keys) removes the listed keys. Unknown keys are silently ignored.