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:
Parameter | Description | Default |
---|---|---|
host | The hostname of the Synnax cluster | localhost |
port | The port of the Synnax cluster | 9090 |
username | The username to authenticate with | "" |
password | The password to authenticate with | "" |
secure | Whether 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 |