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:
npm install @synthetiq/platform-sdk

Instantiate

import { SynthetiqClient } from "@synthetiq/platform-sdk";

const sdk = new SynthetiqClient({
  baseUrl: "https://api.synthetiq.com/api",
  // Called before every request — you own credential storage and refresh.
  getAccessToken: () => process.env.SYNTHETIQ_TOKEN!,
});
OptionRequiredDescription
baseUrlYesPlatform API base, including /api
getAccessTokenYesSync or async function returning a bearer token before each request
extraHeadersNoHeaders sent on every request
fetchNoOverride fetch (tests, instrumentation)
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:
AccessorResource
sdk.organizationsOrganizations
sdk.members, sdk.roles, sdk.scopesMembers & roles
sdk.serviceAccounts, sdk.oidcTrustsService accounts & OIDC trusts
sdk.awsConfigDeployment infrastructure (BYOI)
sdk.storageConfigOrganizations (storage config)
sdk.entitiesEntities & Versions
sdk.shares, sdk.publishers, sdk.storesSharing
sdk.productionAppsProduction apps
sdk.deploysDeployments

Example

// List an org's deployment targets, then trigger a deploy.
const { configs } = await sdk.awsConfig.list(orgId);

const deployment = await sdk.deploys.create({
  productionAppId: app.id,
  versionId: version.id,
});
console.log(deployment.status);

Error handling

Failed requests throw SynthetiqApiError with the HTTP status and the API’s error field:
import { SynthetiqApiError } from "@synthetiq/platform-sdk";

try {
  await sdk.organizations.get(orgId);
} catch (err) {
  if (err instanceof SynthetiqApiError && err.status === 403) {
    // missing scope — see Authentication
  }
}
Authorization is enforced per-resource; see Authentication for the scope model.