FullStacked Cloud · Documentation testd.fullstacked.cloud
View ?format=md View ?format=json
AI agents and scripts: https://d.fullstacked.cloud/?format=md https://d.fullstacked.cloud/?format=json MCP:docs_get({ topic: "runtime" })

Injected process.env

Every FullStacked Cloud project reads its configuration from process.env: the platform hosts, the credentials of linked managed data and Edge tunnels, the project's custom variables, and AUTH_TOKEN, a token of the current user. The environment comes from GET https://g.fullstacked.cloud/api/v1/projects/:id/env, resolved for the caller, plus AUTH_TOKEN added at launch. Code never hardcodes a host, a database user or a token.

Where the environment comes from

Where the code runsprocess.env contains
FullStacked Cloud Client GUIThe resolved environment of the signed-in user plus AUTH_TOKEN = a project-scoped token minted for this run (fsc_prj_..., see below), never their session. If the environment cannot be fetched, the project still runs with AUTH_TOKEN alone.
Local CLI (npx fullstacked)<project>/.env merged with -e KEY=VALUE flags (flags win). Write .env from GET .../env?format=dotenv and pass the token: npx fullstacked -e AUTH_TOKEN=$AUTH_TOKEN with a personal access token (fsc_pat_..., https://c.fullstacked.cloud Settings, Access tokens). Keep .env out of Git.
Project action run (actions/<name>.ts)The environment resolved for the caller of the run, AUTH_TOKEN = the caller's token, plus run variables (see Project Actions).

Variables

VariablePresentValue
AUTH_URLResolved environmentAuthentication service base URL, https://a.fullstacked.cloud here. Use for /api/v1/me, /api/v1/user/access, token exchange.
AUTH_HOSTResolved environmentIts host, a.fullstacked.cloud.
TUNNELS_HOSTResolved environmentTunnels hub host for tunnel.register({ host }), t.fullstacked.cloud.
AUTH_TOKENAt launch onlyA FullStacked Cloud token of the current user: fsc_prj_... (Client GUI, scoped to this project), fsc_pat_... (personal access token, local CLI) or the action caller's token. Never part of GET .../env, never stored in the project.
PG_DATA_TOKEN, REDIS_DATA_TOKEN, MONGO_DATA_TOKEN, S3_DATA_TOKEN, P2P_DATA_TOKENLinked data instancetun_... routing token of the instance's tunnel at the caller's access level. Use as `${AUTH_TOKEN}:${PG_DATA_TOKEN}`.
DATA_USER, DATA_PASSWORDLinked PostgreSQL, Redis, MongoDB, P2Papp_rw or app_ro and its password, matching the caller's access (read-write or read-only).
DATA_DBLinked PostgreSQL, MongoDBDatabase name, e.g. data_pg_1, data_mongo_1. Not set for Redis and P2P.
DATA_KEY_ID, DATA_KEY_SECRET, DATA_BUCKETLinked S3Access key, secret key and bucket name for the caller's access level.
<PREFIX>_TUNNEL_TOKENLinked Edge tunneltun_... token of the tunnel. Use as `${AUTH_TOKEN}:${OFFICE_API_TUNNEL_TOKEN}`.
Custom variablesSet on the projectAny NAME=value stored with PUT .../env (Console: Project, Environment), optionally marked secret.

What AUTH_TOKEN reaches

From the Client GUI, AUTH_TOKEN is a project-scoped token (fsc_prj_...) minted for the signed-in user and this project. It works for everything a project does with it:

  • GET ${AUTH_URL}/api/v1/me: the current user (enterprise users included).
  • GET ${AUTH_URL}/api/v1/user/access: narrowed to this project (read access at most), its linked data instances at the user's level and its linked Edge tunnels; global_permissions and groups are empty.
  • tunnel.register({ authorization: \${AUTH_TOKEN}:${_TOKEN}` })` for every linked data instance and tunnel.
  • Your enterprise backend's validation (POST /v1/authorities/:id/validate, see Runtime Sign-In & BYOA) when the user signed in through your authority.

Anything that manages the account answers 403 PROJECT_TOKEN_SCOPE: tokens, sharing, profile, billing, account deletion. It expires with the user's session and stops reaching the project's resources when the user loses access to the project. Before the first run of a project shared by someone else, the Client GUI shows the user who owns it and what it reaches, and runs it only once they accept. Do not rely on AUTH_TOKEN being present: a run the user has not approved, or an offline run, may have none.

The three platform hosts are part of every resolved environment, for the environment the project belongs to (test here): the same code runs against test and live. They are missing when no environment was resolved: a Client GUI launch whose environment request failed (only AUTH_TOKEN is set), or a local CLI run without a .env written from GET .../env. Check them like any other variable.

Naming rules

  • The oldest linked data instance gets unprefixed names (DATA_USER, PG_DATA_TOKEN, ...).
  • Every other linked data instance gets the same names prefixed with its display name: upper-cased, non-alphanumeric runs replaced by _, leading and trailing _ trimmed, _ prepended before a leading digit (instance analytics-db gives ANALYTICS_DB_DATA_USER, ANALYTICS_DB_PG_DATA_TOKEN, ...).
  • Edge tunnels are always prefixed with the tunnel name, normalized the same way (office-api gives OFFICE_API_TUNNEL_TOKEN). Tunnel names are unique per Edge only: two linked tunnels with the same name produce the same variable, and the second is dropped into conflicts. Give one of them a prefix mapping.
  • A prefix mapping (PUT .../env with mappings) overrides the prefix of one resource; an empty prefix is not allowed (prefix: A-Z then up to 63 of A-Z, 0-9, _).
  • Names never overwrite each other. Platform hosts come first, then linked data (oldest link first), then tunnels, then custom variables; a later entry with an existing name is dropped and reported in conflicts.
  • Resources the caller cannot use are omitted silently, so a variable can be absent for one user and present for another: check before use.
ts
function requireEnv(name: string): string {
    const value = process.env[name];
    if (!value) throw new Error(`${name} is not set: link the resource to the project or run with AUTH_TOKEN`);
    return value;
}

GET /api/v1/projects/:id/env

GET https://g.fullstacked.cloud/api/v1/projects/<projectId>/env?format=json|dotenv with Authorization: Bearer <fsc_* token>. Any project tier may call it; the values are resolved with the caller's own access. MCP: projects_get_env.

json
{
  "projectId": "7f3b89a2-4c1e-48a0-9d21-f8e910243abc",
  "project": "alice/task-flow",
  "accessTier": "FULL_ACCESS",
  "env": {
    "TUNNELS_HOST": "t.fullstacked.cloud",
    "AUTH_HOST": "a.fullstacked.cloud",
    "AUTH_URL": "https://a.fullstacked.cloud",
    "PG_DATA_TOKEN": "tun_4b8c9d...",
    "DATA_USER": "app_rw",
    "DATA_PASSWORD": "...",
    "DATA_DB": "data_pg_1",
    "OFFICE_API_TUNNEL_TOKEN": "tun_3f9a2b...",
    "APP_TITLE": "Task Flow",
    "MAPS_API_KEY": "AIza..."
  },
  "meta": { "PG_DATA_TOKEN": { "source": "linked_data", "resourceId": "9b2f6c1e-...", "name": "tasks-db", "engine": "postgres", "access": "READ_WRITE", "secret": true } },
  "resources": [{ "source": "linked_data", "resourceId": "9b2f6c1e-...", "name": "tasks-db", "prefix": "", "mapped": false }],
  "variables": { "APP_TITLE": "Task Flow", "MAPS_API_KEY": "AIza..." },
  "secrets": ["MAPS_API_KEY"],
  "mappings": {},
  "conflicts": []
}

meta has one entry per variable (source: platform, linked_data, linked_tunnel or custom; secret is false only for hosts, DATA_USER, DATA_DB, DATA_BUCKET and custom variables not marked secret; secrets lists the custom variables marked secret). format=dotenv returns the same env as KEY=value lines.

PUT /api/v1/projects/:id/env

Requires write on the project. MCP: projects_set_env.

json
{ "variables": { "APP_TITLE": "Task Flow", "MAPS_API_KEY": { "value": "AIza...", "secret": true }, "OLD_FLAG": null }, "mappings": { "<resourceId>": { "prefix": "CACHE" } } }
  • null removes a variable or mapping.
  • A variable is a string or { "value"?, "secret"? }: secret: true marks it secret, false unmarks it, and a plain string keeps the current flag (omit value to change only the flag).
  • Names: ^[A-Z_][A-Z0-9_]{0,127}$; values: single-line strings up to 4096 characters; at most 200 variables and 100 mappings.
  • Setting AUTH_TOKEN, AUTH_URL, AUTH_HOST or TUNNELS_HOST is refused (400 RESERVED_VARIABLE).
  • Custom variables reach every project tier, including release-only users, because the code needs them wherever it runs. Marking one secret masks it in the Console and flags it in meta; it does not hide it from members who run the project. Keep values only a backend may hold out of custom variables.

Endpoints

GET /api/v1/projects/:id/env

The project's resolved runtime environment: DATA_* wiring and tokens of linked instances, platform URLs (AUTH_URL, AUTH_HOST, TUNNELS_HOST) and custom variables. ?format=json|dotenv; never contains AUTH_TOKEN.

  • Service: git (https://g.fullstacked.cloud)
  • Auth: Bearer fsc_*

curl:

bash
curl -sS -H "Authorization: Bearer $AUTH_TOKEN" "https://g.fullstacked.cloud/api/v1/projects/<projectId>/env?format=dotenv"

PUT /api/v1/projects/:id/env

Merges { variables?, mappings? } into the project's environment config (null removes a key). Needs write.

  • Service: git (https://g.fullstacked.cloud)
  • Auth: Bearer fsc_*

Request:

json
{
  "variables": {
    "API_BASE": "https://example.com"
  }
}