Skip to main content
@synthetiq/platform-sdk is the official Node/TypeScript client for the Platform API. It’s the same library the CLI is built on, so anything the CLI does, you can script. Every REST resource in this section has a typed accessor on the client.

Install

The SDK ships from the same private registry as the CLI — see CLI installation for the registry/auth setup, then:

Instantiate

getAccessToken is a callback so the SDK never owns credentials: the CLI reads its credentials file, the desktop app its session, and CI does an OIDC token exchange.

Resource accessors

Each accessor maps to a resource in this section:

Example

Setting an avatar is a three-step flow — request a signed URL, upload the bytes, point the profile at it — wrapped in one call:
uploadAvatar sends back the exact publicUrl the API issued. The API only accepts avatar URLs it issued for that user, so a reconstructed URL is rejected.

Error handling

Failed requests throw SynthetiqApiError with the HTTP status and the API’s error message. When the API returns a coded error, the machine-readable code and the parsed response body are on the error as well:
Authorization is enforced per-resource; see Authentication for the scope model.