Synnax TypeScript Client

Learn how to use our TypeScript client to interact with a Synnax cluster.

Installation

The TypeScript client is available on npm, and can be installed with your package manager of choice. We’ll be using npm in our documentation, but feel free to use yarn, pnpm, or any other package manager you prefer.

npm install @synnaxlabs/client

Authenticating with a Cluster

To authenticate with a Synnax cluster, simply instantiate a new client with your connection parameters and credentials:

import { Synnax } from "@synnaxlabs/client";

const client = new Synnax({
  host: "demo.synnaxlabs.com",
  port: 9090,
  username: "synnax",
  password: "seldon",
  secure: true,
});

Here’s a breakdown of the parameters you can pass to the client:

ParameterDescriptionDefault
hostThe hostname of the Synnax clusterlocalhost
portThe port of the Synnax cluster9090
usernameThe username to authenticate with""
passwordThe password to authenticate with""
secureWhether to use TLS encryption. This should be set to true if the cluster is using TLS. This should be true for [clusters running in production].false