Optionaloptions: { env?: string; host?: string; token?: string }ProtectedenvProtectedhostProtectedtokenSet a single variable, preserving the rest.
A read-modify-write over a replace-everything PATCH, so concurrent writers
can lose each other's updates. Prefer updateVariables when setting more
than one key.
Set a single variable, preserving the rest.
A read-modify-write over a replace-everything PATCH, so concurrent writers
can lose each other's updates. Prefer updateVariables when setting more
than one key.
Read variables for the current environment (X-Project-Env, defaults to dev).
With no argument this returns the CALLING APP's own variables and needs no
permission at all. With a ref it reads that app's variables and needs
manage forge.
Optionalref: stringApp uuid, name or tag. Omit for the current app.
Run a Forge service: runService(target, body?, { query?, headers? }).
Mirrors axios.post(url, data, config) — the 2nd arg is the request payload.
target is either:
prn:forge:{ref}:service/{name} — runs it on ANOTHER app,
where ref is the app's name or uuid. A name is resolved by the
runtime deterministically (marketplace → custom); use the uuid to pin a
specific app. This is the addressing to use where there's no ambient
"current app" — e.g. a workflow, which has no per-install uuid to hardcode.body is sent as the POST body; options.query / options.headers are optional.
The current app's uuid (bare-name form) is resolved automatically from the platform context (FORGE_APP_UUID for public views, forge_app_uuid in sessionStorage for platform views), so app code never needs its own uuid.
Resolving the app does NOT grant access. Execution is still authorized against
the caller's permissions — for a platform-access service the caller must hold
service::{name} forge::{appUuid}; public-access services require none. An
app's own runtime token is implicitly granted this for all of its own services.
Optionalbody: anyOptionaloptions: { headers?: Record<string, string>; query?: Record<string, string> }Replace the variable set for the current environment.
This REPLACES the whole set for that environment — keys absent from
variables are removed. The other environment is left untouched.
The self form needs manage_variables forge, which only ever writes the
calling app. Targeting another app by ref needs manage forge.
Replace the variable set for the current environment.
This REPLACES the whole set for that environment — keys absent from
variables are removed. The other environment is left untouched.
The self form needs manage_variables forge, which only ever writes the
calling app. Targeting another app by ref needs manage forge.
Base client for the platform API Classes that extend PlatformBaseClient have intentins of only working in platform context
PlatformBaseClient
Param: client
The axios instance to use for the client
Example