hathora / cloud-sdk-typescript

Hathora Cloud TypeScript SDK
https://hathora.dev/docs
MIT License
2 stars 3 forks source link
api game-server-hosting hathora multiplayer sdk typescript

Typescript SDK

Serverless cloud hosting for multiplayer games

Summary

Hathora Cloud API: Welcome to the Hathora Cloud API documentation! Learn how to use the Hathora Cloud APIs to build and scale your game servers globally.

Table of Contents

SDK Installation

The SDK can be installed with either npm, pnpm, bun or yarn package managers.

NPM

npm add @hathora/cloud-sdk-typescript

PNPM

pnpm add @hathora/cloud-sdk-typescript

Bun

bun add @hathora/cloud-sdk-typescript

Yarn

yarn add @hathora/cloud-sdk-typescript zod

# Note that Yarn does not install peer dependencies automatically. You will need
# to install zod as shown above.

SDK Example Usage

Example

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
    hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
    const result = await hathoraCloud.tokensV1.getOrgTokens(
        "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"
    );

    // Handle the result
    console.log(result);
}

run();

Available Resources and Operations

tokensV1

roomsV1

roomsV2

processesV1

processesV2

processesV3

organizationsV1

metricsV1

managementV1

logsV1

lobbiesV1

lobbiesV2

lobbiesV3

discoveryV1

discoveryV2

deploymentsV1

deploymentsV2

deploymentsV3

buildsV1

buildsV2

buildsV3

billingV1

authV1

appsV1

appsV2

Error Handling

All SDK methods return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.

Error Object Status Code Content Type
errors.ApiError 401,404,429 application/json
errors.SDKError 4xx-5xx /

Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The SDKValidationError that is thrown as a result will capture the raw value that failed validation in an attribute called rawValue. Additionally, a pretty() method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging.

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";
import { ApiError, SDKValidationError } from "@hathora/cloud-sdk-typescript/models/errors";

const hathoraCloud = new HathoraCloud({
    hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
    let result;
    try {
        result = await hathoraCloud.tokensV1.getOrgTokens(
            "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"
        );

        // Handle the result
        console.log(result);
    } catch (err) {
        switch (true) {
            case err instanceof SDKValidationError: {
                // Validation errors can be pretty-printed
                console.error(err.pretty());
                // Raw value may also be inspected
                console.error(err.rawValue);
                return;
            }
            case err instanceof ApiError: {
                // Handle err.data$: ApiErrorData
                console.error(err);
                return;
            }
            default: {
                throw err;
            }
        }
    }
}

run();

Server Selection

Select Server by Index

You can override the default server globally by passing a server index to the serverIdx optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

# Server Variables
0 https://api.hathora.dev None
1 https:/// None
import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
    serverIdx: 1,
    hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
    const result = await hathoraCloud.tokensV1.getOrgTokens(
        "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"
    );

    // Handle the result
    console.log(result);
}

run();

Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the serverURL optional parameter when initializing the SDK client instance. For example:

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
    serverURL: "https://api.hathora.dev",
    hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
    const result = await hathoraCloud.tokensV1.getOrgTokens(
        "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"
    );

    // Handle the result
    console.log(result);
}

run();

Custom HTTP Client

The TypeScript SDK makes API calls using an HTTPClient that wraps the native Fetch API. This client is a thin wrapper around fetch and provides the ability to attach hooks around the request lifecycle that can be used to modify the request or handle errors and response.

The HTTPClient constructor takes an optional fetcher argument that can be used to integrate a third-party HTTP client or when writing tests to mock out the HTTP client and feed in fixtures.

The following example shows how to use the "beforeRequest" hook to to add a custom header and a timeout to requests and how to use the "requestError" hook to log errors:

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";
import { HTTPClient } from "@hathora/cloud-sdk-typescript/lib/http";

const httpClient = new HTTPClient({
  // fetcher takes a function that has the same signature as native `fetch`.
  fetcher: (request) => {
    return fetch(request);
  }
});

httpClient.addHook("beforeRequest", (request) => {
  const nextRequest = new Request(request, {
    signal: request.signal || AbortSignal.timeout(5000)
  });

  nextRequest.headers.set("x-custom-header", "custom value");

  return nextRequest;
});

httpClient.addHook("requestError", (error, request) => {
  console.group("Request Error");
  console.log("Reason:", `${error}`);
  console.log("Endpoint:", `${request.method} ${request.url}`);
  console.groupEnd();
});

const sdk = new HathoraCloud({ httpClient });

Authentication

Per-Client Security Schemes

This SDK supports the following security scheme globally:

Name Type Scheme
hathoraDevToken http HTTP Bearer

To authenticate with the API the hathoraDevToken parameter must be set when initializing the SDK client instance. For example:

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
    hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
    const result = await hathoraCloud.tokensV1.getOrgTokens(
        "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"
    );

    // Handle the result
    console.log(result);
}

run();

Per-Operation Security Schemes

Some operations in this SDK require the security scheme to be specified at the request level. For example:

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
    const result = await hathoraCloud.lobbiesV1.createPrivateLobbyDeprecated(
        {
            playerAuth: "<YOUR_BEARER_TOKEN_HERE>",
        },
        "app-af469a92-5b45-4565-b3c4-b79878de67d2"
    );

    // Handle the result
    console.log(result);
}

run();

Standalone functions

All the methods listed above are available as standalone functions. These functions are ideal for use in applications running in the browser, serverless runtimes or other environments where application bundle size is a primary concern. When using a bundler to build your application, all unused functionality will be either excluded from the final bundle or tree-shaken away.

To read more about standalone functions, check FUNCTIONS.md.

Available standalone functions - [appsV1CreateAppV1Deprecated](docs/sdks/appsv1/README.md#createappv1deprecated) - [appsV1DeleteAppV1Deprecated](docs/sdks/appsv1/README.md#deleteappv1deprecated) - [appsV1GetAppInfoV1Deprecated](docs/sdks/appsv1/README.md#getappinfov1deprecated) - [appsV1GetAppsV1Deprecated](docs/sdks/appsv1/README.md#getappsv1deprecated) - [appsV1UpdateAppV1Deprecated](docs/sdks/appsv1/README.md#updateappv1deprecated) - [appsV2CreateApp](docs/sdks/appsv2/README.md#createapp) - [appsV2DeleteApp](docs/sdks/appsv2/README.md#deleteapp) - [appsV2GetApp](docs/sdks/appsv2/README.md#getapp) - [appsV2GetApps](docs/sdks/appsv2/README.md#getapps) - [appsV2UpdateApp](docs/sdks/appsv2/README.md#updateapp) - [authV1LoginAnonymous](docs/sdks/authv1/README.md#loginanonymous) - [authV1LoginGoogle](docs/sdks/authv1/README.md#logingoogle) - [authV1LoginNickname](docs/sdks/authv1/README.md#loginnickname) - [billingV1GetBalance](docs/sdks/billingv1/README.md#getbalance) - [billingV1GetInvoices](docs/sdks/billingv1/README.md#getinvoices) - [billingV1GetPaymentMethod](docs/sdks/billingv1/README.md#getpaymentmethod) - [billingV1GetUpcomingInvoiceItems](docs/sdks/billingv1/README.md#getupcominginvoiceitems) - [billingV1GetUpcomingInvoiceTotal](docs/sdks/billingv1/README.md#getupcominginvoicetotal) - [billingV1InitStripeCustomerPortalUrl](docs/sdks/billingv1/README.md#initstripecustomerportalurl) - [buildsV1CreateBuildDeprecated](docs/sdks/buildsv1/README.md#createbuilddeprecated) - [buildsV1DeleteBuildDeprecated](docs/sdks/buildsv1/README.md#deletebuilddeprecated) - [buildsV1GetBuildInfoDeprecated](docs/sdks/buildsv1/README.md#getbuildinfodeprecated) - [buildsV1GetBuildsDeprecated](docs/sdks/buildsv1/README.md#getbuildsdeprecated) - [buildsV1RunBuildDeprecated](docs/sdks/buildsv1/README.md#runbuilddeprecated) - [buildsV2CreateBuildV2Deprecated](docs/sdks/buildsv2/README.md#createbuildv2deprecated) - [buildsV2CreateBuildWithUploadUrlV2Deprecated](docs/sdks/buildsv2/README.md#createbuildwithuploadurlv2deprecated) - [buildsV2CreateWithMultipartUploadsV2Deprecated](docs/sdks/buildsv2/README.md#createwithmultipartuploadsv2deprecated) - [buildsV2DeleteBuildV2Deprecated](docs/sdks/buildsv2/README.md#deletebuildv2deprecated) - [buildsV2GetBuildInfoV2Deprecated](docs/sdks/buildsv2/README.md#getbuildinfov2deprecated) - [buildsV2GetBuildsV2Deprecated](docs/sdks/buildsv2/README.md#getbuildsv2deprecated) - [buildsV2RunBuildV2Deprecated](docs/sdks/buildsv2/README.md#runbuildv2deprecated) - [buildsV3CreateBuild](docs/sdks/buildsv3/README.md#createbuild) - [buildsV3DeleteBuild](docs/sdks/buildsv3/README.md#deletebuild) - [buildsV3GetBuild](docs/sdks/buildsv3/README.md#getbuild) - [buildsV3GetBuilds](docs/sdks/buildsv3/README.md#getbuilds) - [buildsV3RunBuild](docs/sdks/buildsv3/README.md#runbuild) - [deploymentsV1CreateDeploymentV1Deprecated](docs/sdks/deploymentsv1/README.md#createdeploymentv1deprecated) - [deploymentsV1GetDeploymentInfoV1Deprecated](docs/sdks/deploymentsv1/README.md#getdeploymentinfov1deprecated) - [deploymentsV1GetDeploymentsV1Deprecated](docs/sdks/deploymentsv1/README.md#getdeploymentsv1deprecated) - [deploymentsV1GetLatestDeploymentV1Deprecated](docs/sdks/deploymentsv1/README.md#getlatestdeploymentv1deprecated) - [deploymentsV2CreateDeploymentV2Deprecated](docs/sdks/deploymentsv2/README.md#createdeploymentv2deprecated) - [deploymentsV2GetDeploymentInfoV2Deprecated](docs/sdks/deploymentsv2/README.md#getdeploymentinfov2deprecated) - [deploymentsV2GetDeploymentsV2Deprecated](docs/sdks/deploymentsv2/README.md#getdeploymentsv2deprecated) - [deploymentsV2GetLatestDeploymentV2Deprecated](docs/sdks/deploymentsv2/README.md#getlatestdeploymentv2deprecated) - [deploymentsV3CreateDeployment](docs/sdks/deploymentsv3/README.md#createdeployment) - [deploymentsV3GetDeployment](docs/sdks/deploymentsv3/README.md#getdeployment) - [deploymentsV3GetDeployments](docs/sdks/deploymentsv3/README.md#getdeployments) - [deploymentsV3GetLatestDeployment](docs/sdks/deploymentsv3/README.md#getlatestdeployment) - [discoveryV1GetPingServiceEndpointsDeprecated](docs/sdks/discoveryv1/README.md#getpingserviceendpointsdeprecated) - [discoveryV2GetPingServiceEndpoints](docs/sdks/discoveryv2/README.md#getpingserviceendpoints) - [lobbiesV1CreatePrivateLobbyDeprecated](docs/sdks/lobbiesv1/README.md#createprivatelobbydeprecated) - [lobbiesV1CreatePublicLobbyDeprecated](docs/sdks/lobbiesv1/README.md#createpubliclobbydeprecated) - [lobbiesV1ListActivePublicLobbiesDeprecatedV1](docs/sdks/lobbiesv1/README.md#listactivepubliclobbiesdeprecatedv1) - [lobbiesV2CreateLobbyDeprecated](docs/sdks/lobbiesv2/README.md#createlobbydeprecated) - [lobbiesV2CreateLocalLobby](docs/sdks/lobbiesv2/README.md#createlocallobby) - [lobbiesV2CreatePrivateLobby](docs/sdks/lobbiesv2/README.md#createprivatelobby) - [lobbiesV2CreatePublicLobby](docs/sdks/lobbiesv2/README.md#createpubliclobby) - [lobbiesV2GetLobbyInfo](docs/sdks/lobbiesv2/README.md#getlobbyinfo) - [lobbiesV2ListActivePublicLobbiesDeprecatedV2](docs/sdks/lobbiesv2/README.md#listactivepubliclobbiesdeprecatedv2) - [lobbiesV2SetLobbyState](docs/sdks/lobbiesv2/README.md#setlobbystate) - [lobbiesV3CreateLobby](docs/sdks/lobbiesv3/README.md#createlobby) - [lobbiesV3GetLobbyInfoByRoomId](docs/sdks/lobbiesv3/README.md#getlobbyinfobyroomid) - [lobbiesV3GetLobbyInfoByShortCode](docs/sdks/lobbiesv3/README.md#getlobbyinfobyshortcode) - [lobbiesV3ListActivePublicLobbies](docs/sdks/lobbiesv3/README.md#listactivepubliclobbies) - [logsV1DownloadLogForProcess](docs/sdks/logsv1/README.md#downloadlogforprocess) - [logsV1GetLogsForApp](docs/sdks/logsv1/README.md#getlogsforapp) - [logsV1GetLogsForDeployment](docs/sdks/logsv1/README.md#getlogsfordeployment) - [logsV1GetLogsForProcess](docs/sdks/logsv1/README.md#getlogsforprocess) - [managementV1SendVerificationEmail](docs/sdks/managementv1/README.md#sendverificationemail) - [metricsV1GetMetrics](docs/sdks/metricsv1/README.md#getmetrics) - [organizationsV1AcceptInvite](docs/sdks/organizationsv1/README.md#acceptinvite) - [organizationsV1GetOrgMembers](docs/sdks/organizationsv1/README.md#getorgmembers) - [organizationsV1GetOrgPendingInvites](docs/sdks/organizationsv1/README.md#getorgpendinginvites) - [organizationsV1GetOrgs](docs/sdks/organizationsv1/README.md#getorgs) - [organizationsV1GetUserPendingInvites](docs/sdks/organizationsv1/README.md#getuserpendinginvites) - [organizationsV1InviteUser](docs/sdks/organizationsv1/README.md#inviteuser) - [organizationsV1RejectInvite](docs/sdks/organizationsv1/README.md#rejectinvite) - [organizationsV1RescindInvite](docs/sdks/organizationsv1/README.md#rescindinvite) - [processesV1GetProcessInfoDeprecated](docs/sdks/processesv1/README.md#getprocessinfodeprecated) - [processesV1GetRunningProcesses](docs/sdks/processesv1/README.md#getrunningprocesses) - [processesV1GetStoppedProcesses](docs/sdks/processesv1/README.md#getstoppedprocesses) - [processesV2CreateProcessV2Deprecated](docs/sdks/processesv2/README.md#createprocessv2deprecated) - [processesV2GetLatestProcessesV2Deprecated](docs/sdks/processesv2/README.md#getlatestprocessesv2deprecated) - [processesV2GetProcessInfoV2Deprecated](docs/sdks/processesv2/README.md#getprocessinfov2deprecated) - [processesV2GetProcessesCountExperimentalV2Deprecated](docs/sdks/processesv2/README.md#getprocessescountexperimentalv2deprecated) - [processesV2StopProcessV2Deprecated](docs/sdks/processesv2/README.md#stopprocessv2deprecated) - [processesV3CreateProcess](docs/sdks/processesv3/README.md#createprocess) - [processesV3GetLatestProcesses](docs/sdks/processesv3/README.md#getlatestprocesses) - [processesV3GetProcess](docs/sdks/processesv3/README.md#getprocess) - [processesV3GetProcessesCountExperimental](docs/sdks/processesv3/README.md#getprocessescountexperimental) - [processesV3StopProcess](docs/sdks/processesv3/README.md#stopprocess) - [roomsV1CreateRoomDeprecated](docs/sdks/roomsv1/README.md#createroomdeprecated) - [roomsV1DestroyRoomDeprecated](docs/sdks/roomsv1/README.md#destroyroomdeprecated) - [roomsV1GetActiveRoomsForProcessDeprecated](docs/sdks/roomsv1/README.md#getactiveroomsforprocessdeprecated) - [roomsV1GetConnectionInfoDeprecated](docs/sdks/roomsv1/README.md#getconnectioninfodeprecated) - [roomsV1GetInactiveRoomsForProcessDeprecated](docs/sdks/roomsv1/README.md#getinactiveroomsforprocessdeprecated) - [roomsV1GetRoomInfoDeprecated](docs/sdks/roomsv1/README.md#getroominfodeprecated) - [roomsV1SuspendRoomDeprecated](docs/sdks/roomsv1/README.md#suspendroomdeprecated) - [roomsV2CreateRoom](docs/sdks/roomsv2/README.md#createroom) - [roomsV2DestroyRoom](docs/sdks/roomsv2/README.md#destroyroom) - [roomsV2GetActiveRoomsForProcess](docs/sdks/roomsv2/README.md#getactiveroomsforprocess) - [roomsV2GetConnectionInfo](docs/sdks/roomsv2/README.md#getconnectioninfo) - [roomsV2GetInactiveRoomsForProcess](docs/sdks/roomsv2/README.md#getinactiveroomsforprocess) - [roomsV2GetRoomInfo](docs/sdks/roomsv2/README.md#getroominfo) - [roomsV2SuspendRoomV2Deprecated](docs/sdks/roomsv2/README.md#suspendroomv2deprecated) - [roomsV2UpdateRoomConfig](docs/sdks/roomsv2/README.md#updateroomconfig) - [tokensV1CreateOrgToken](docs/sdks/tokensv1/README.md#createorgtoken) - [tokensV1GetOrgTokens](docs/sdks/tokensv1/README.md#getorgtokens) - [tokensV1RevokeOrgToken](docs/sdks/tokensv1/README.md#revokeorgtoken)

Global Parameters

A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.

For example, you can set appId to "app-af469a92-5b45-4565-b3c4-b79878de67d2" at SDK initialization and then you do not have to pass the same value on calls to operations like createRoomDeprecated. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.

Available Globals

The following global parameter is available.

Name Type Required Description
appId string The appId parameter.

Example

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
    hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
    const result = await hathoraCloud.roomsV1.createRoomDeprecated(
        {
            roomConfig: '{"name":"my-room"}',
            region: "Chicago",
        },
        "app-af469a92-5b45-4565-b3c4-b79878de67d2",
        "2swovpy1fnunu"
    );

    // Handle the result
    console.log(result);
}

run();

Requirements

For supported JavaScript runtimes, please consult RUNTIMES.md.

File uploads

Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.

[!TIP]

Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:

  • Node.js v20+: Since v20, Node.js comes with a native openAsBlob function in node:fs.
  • Bun: The native Bun.file function produces a file handle that can be used for streaming file uploads.
  • Browsers: All supported browsers return an instance to a File when reading the value from an <input type="file"> element.
  • Node.js v18: A file stream can be created using the fileFrom helper from fetch-blob/from.js.
import { HathoraCloud } from "@hathora/cloud-sdk-typescript";
import { openAsBlob } from "node:fs";

const hathoraCloud = new HathoraCloud({
    hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
    const result = await hathoraCloud.buildsV1.runBuildDeprecated(
        1,
        {
            file: await openAsBlob("./sample-file"),
        },
        "app-af469a92-5b45-4565-b3c4-b79878de67d2"
    );

    // Handle the result
    console.log(result);
}

run();

Retries

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
    hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
    const result = await hathoraCloud.tokensV1.getOrgTokens(
        "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39",
        {
            retries: {
                strategy: "backoff",
                backoff: {
                    initialInterval: 1,
                    maxInterval: 50,
                    exponent: 1.1,
                    maxElapsedTime: 100,
                },
                retryConnectionErrors: false,
            },
        }
    );

    // Handle the result
    console.log(result);
}

run();

If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
    retryConfig: {
        strategy: "backoff",
        backoff: {
            initialInterval: 1,
            maxInterval: 50,
            exponent: 1.1,
            maxElapsedTime: 100,
        },
        retryConnectionErrors: false,
    },
    hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
    const result = await hathoraCloud.tokensV1.getOrgTokens(
        "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"
    );

    // Handle the result
    console.log(result);
}

run();

Debugging

You can setup your SDK to emit debug logs for SDK requests and responses.

You can pass a logger that matches console's interface as an SDK option.

[!WARNING] Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const sdk = new HathoraCloud({ debugLogger: console });

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release !

SDK Created by Speakeasy