Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt

Use this file to discover all available pages before exploring further.

app.envs exposes the EnvsModule, which lets you manage the KEY=value pairs your application sees at runtime.
const app = await api.applications.fetch("abc123def456abc123def456");
app.envs; // EnvsModule
Every method resolves to the full env set after the operation completes — so you always get an up-to-date { key: value } map back.

Listing environment variables

const envs = await app.envs.list();

console.log(envs);
// { DATABASE_URL: "postgres://...", FEATURE_FLAG: "true" }

Adding or updating variables

app.envs.set(envs) merges new variables into the existing set. Existing keys not present in the call are preserved.
await app.envs.set({
    DATABASE_URL: "postgres://...",
    FEATURE_FLAG: "true",
});

Replacing the entire env set

app.envs.replace(envs) overwrites every variable. Anything not listed is removed.
await app.envs.replace({
    DATABASE_URL: "postgres://new-host...",
});
// FEATURE_FLAG is now gone
Pass an empty object to wipe all variables:
await app.envs.replace({});

Deleting variables

app.envs.delete(keys) removes the listed keys. Unknown keys are silently ignored.
await app.envs.delete(["FEATURE_FLAG"]);