Skip to main content

Overview

The TypeScript SDKs script the Reelevant platform with the same validation as its editors. This lists the Datasources of your account with the Data SDK:
Reelevant exposes the same platform through three layers. Every layer calls the one below it, so you choose how much validation you want to rebuild yourself. The REST API accepts any payload that matches its schema. A Workflow that references a field missing from its Datasource, or a Branch without an Output Node, is saved and only fails in the Runner. The SDKs load the Datasources and Contents the Workflow uses and reject these changes before they reach the API.

Packages

All SDKs are written in TypeScript and ship their type declarations. The declarations are the method reference: this section explains the concepts and the main flows, not every method.

Installation

The SDKs are published on GitHub Packages. Ask your Reelevant contact for read access, then point the @reelevant-tech scope to the registry with a GitHub token that has the read:packages scope:
.npmrc
Each SDK expects the generated API clients it calls (@reelevant-tech/*-openapi-client) as peer dependencies. Install the versions your package manager reports as missing peers, so your code and the SDK share the same client instances.

Authentication

Every SDK call is authenticated with an access token. For scripts and CI, use a service account and the client credentials grant. The token carries the permissions of its user or service account, and the SDKs only see the resources of its Teams (Resource Groups). The SDKs accept either configured API clients or an axios configuration, so the header is set once:

Errors

The SDKs fail at two levels:
  • Before any request: invalid input is rejected locally. The Workflows SDK returns a list of WorkflowError, the Data SDK throws a ZodError or a dedicated validation error, the Content SDK returns the result of validateTemplate.
  • On the API: non-2xx responses are thrown. The Data SDK wraps them in DatasourcesApiError (status, errorCode, data); the other SDKs let the axios error through.
Each guide shows how to handle both.