The 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. See production for more information.false

Next Steps

Now that you’ve installed and authenticated the client, you’re ready to start using Synnax! We recommend starting with the Channels section to learn how to create channels and retrieve data from them.