SDK Reference
Typescript SDK
Client

Client Configuration

A Hatchet client is initialized via:

import Hatchet from "@hatchet-dev/typescript-sdk";
 
const hatchet = Hatchet.init();

You can configure the Hatchet client by setting environment variables or setting the config directly when initializing the client. The following are the most common environment variables to configure and are considered stable:

VariableDescriptionDefault
HATCHET_CLIENT_TOKENThe tenant-scoped API token to use.N/A
HATCHET_CLIENT_TLS_STRATEGYThe TLS strategy to use. Valid values are none, tls, and mtls.tls
HATCHET_CLIENT_NAMESPACEThe namespace to use.N/A

You can also configure the client by overriding the ClientConfig argument on the Hatchet initializer. For example:

import Hatchet from "@hatchet-dev/typescript-sdk";
 
const hatchet = Hatchet.init({
  token: "my-token",
  namespace: "my-namespace",
});

This is most commonly used to set the namespace or pass in a token.