{"id":18383952,"url":"https://github.com/speakeasy-sdks/hathora-sdk-typescript","last_synced_at":"2025-09-19T10:10:02.430Z","repository":{"id":208702588,"uuid":"722176752","full_name":"speakeasy-sdks/hathora-sdk-typescript","owner":"speakeasy-sdks","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-22T16:18:54.000Z","size":161,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-09T11:47:30.455Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/speakeasy-sdks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.md","support":null,"governance":null}},"created_at":"2023-11-22T15:44:04.000Z","updated_at":"2023-11-22T16:19:00.000Z","dependencies_parsed_at":"2023-11-22T21:39:56.136Z","dependency_job_id":null,"html_url":"https://github.com/speakeasy-sdks/hathora-sdk-typescript","commit_stats":null,"previous_names":["speakeasy-sdks/hathora-sdk-typescript"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/speakeasy-sdks/hathora-sdk-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-sdks%2Fhathora-sdk-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-sdks%2Fhathora-sdk-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-sdks%2Fhathora-sdk-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-sdks%2Fhathora-sdk-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/speakeasy-sdks","download_url":"https://codeload.github.com/speakeasy-sdks/hathora-sdk-typescript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-sdks%2Fhathora-sdk-typescript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275918663,"owners_count":25552458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-19T02:00:09.700Z","response_time":108,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T01:13:05.603Z","updated_at":"2025-09-19T10:10:02.379Z","avatar_url":"https://github.com/speakeasy-sdks.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @speakeasy-sdks/hathora-sdk-typescript\n\n\u003cdiv align=\"left\"\u003e\n    \u003ca href=\"https://speakeasyapi.dev/\"\u003e\u003cimg src=\"https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge\u0026logoColor=FBE331\u0026logo=speakeasy\u0026labelColor=545454\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/speakeasy-sdks/hathora-sdk-typescript.git/actions\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/speakeasy-sdks/hathora-sdk-typescript/speakeasy_sdk_generation.yml?style=for-the-badge\" /\u003e\u003c/a\u003e\n    \n\u003c/div\u003e\n\n\n## 🏗 **Welcome to your new SDK!** 🏗\n\nIt has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps:\n- [ ] 🛠 Make your SDK feel handcrafted by [customizing it](https://www.speakeasyapi.dev/docs/customize-sdks)\n- [ ] ♻️ Refine your SDK quickly by iterating locally with the [Speakeasy CLI](https://github.com/speakeasy-api/speakeasy)\n- [ ] 🎁 Publish your SDK to package managers by [configuring automatic publishing](https://www.speakeasyapi.dev/docs/productionize-sdks/publish-sdks)\n- [ ] ✨ When ready to productionize, delete this section from the README\n\u003c!-- Start SDK Installation --\u003e\n## SDK Installation\n\n### NPM\n\n```bash\nnpm add https://github.com/hathora/cloud-sdk-typescript\n```\n\n### Yarn\n\n```bash\nyarn add https://github.com/hathora/cloud-sdk-typescript\n```\n\u003c!-- End SDK Installation --\u003e\n\n## SDK Example Usage\n\u003c!-- Start SDK Example Usage --\u003e\n### Example\n\n```typescript\nimport { HathoraCloud } from \"@speakeasy-sdks/hathora-sdk-typescript\";\n\nasync function run() {\n  const sdk = new HathoraCloud({\n      security: {\n        hathoraDevToken: \"\",\n      },\n      appId: \"app-af469a92-5b45-4565-b3c4-b79878de67d2\",\n    });\n\n  \n  const res = await sdk.appV1.createApp({\n      appName: \"minecraft\",\n      authConfiguration: {\n        anonymous: {},\n        google: {\n          clientId: \"string\",\n        },\n        nickname: {},\n      },\n    });\n\n  if (res?.statusCode !== 200) {\n    throw new Error(\"Unexpected status code: \" + res?.statusCode || \"-\");\n  }\n  \n  // handle response\n}\n\nrun();\n```\n\u003c!-- End SDK Example Usage --\u003e\n\n\u003c!-- Start SDK Available Operations --\u003e\n## Available Resources and Operations\n\n\n### [appV1](docs/sdks/appv1/README.md)\n\n* [createApp](docs/sdks/appv1/README.md#createapp) - Create a new [application](https://hathora.dev/docs/concepts/hathora-entities#application).\n* [deleteApp](docs/sdks/appv1/README.md#deleteapp) - Delete an [application](https://hathora.dev/docs/concepts/hathora-entities#application) using `appId`. Your organization will lose access to this application.\n* [getAppInfo](docs/sdks/appv1/README.md#getappinfo) - Get details for an [application](https://hathora.dev/docs/concepts/hathora-entities#application) using `appId`.\n* [getApps](docs/sdks/appv1/README.md#getapps) - Returns an unsorted list of your organization’s [applications](https://hathora.dev/docs/concepts/hathora-entities#application). An application is uniquely identified by an `appId`.\n* [updateApp](docs/sdks/appv1/README.md#updateapp) - Update data for an existing [application](https://hathora.dev/docs/concepts/hathora-entities#application) using `appId`.\n\n### [authV1](docs/sdks/authv1/README.md)\n\n* [loginAnonymous](docs/sdks/authv1/README.md#loginanonymous) - Returns a unique player token for an anonymous user.\n* [loginGoogle](docs/sdks/authv1/README.md#logingoogle) - Returns a unique player token using a Google-signed OIDC `idToken`.\n* [loginNickname](docs/sdks/authv1/README.md#loginnickname) - Returns a unique player token with a specified nickname for a user.\n\n### [billingV1](docs/sdks/billingv1/README.md)\n\n* [getBalance](docs/sdks/billingv1/README.md#getbalance)\n* [getInvoices](docs/sdks/billingv1/README.md#getinvoices)\n* [getPaymentMethod](docs/sdks/billingv1/README.md#getpaymentmethod)\n* [initStripeCustomerPortalUrl](docs/sdks/billingv1/README.md#initstripecustomerportalurl)\n\n### [buildV1](docs/sdks/buildv1/README.md)\n\n* [createBuild](docs/sdks/buildv1/README.md#createbuild) - Creates a new [build](https://hathora.dev/docs/concepts/hathora-entities#build). Responds with a `buildId` that you must pass to [`RunBuild()`](https://hathora.dev/api#tag/BuildV1/operation/RunBuild) to build the game server artifact. You can optionally pass in a `buildTag` to associate an external version with a build.\n* [deleteBuild](docs/sdks/buildv1/README.md#deletebuild) - Delete a [build](https://hathora.dev/docs/concepts/hathora-entities#build). All associated metadata is deleted.\n* [getBuildInfo](docs/sdks/buildv1/README.md#getbuildinfo) - Get details for a [build](https://hathora.dev/docs/concepts/hathora-entities#build).\n* [getBuilds](docs/sdks/buildv1/README.md#getbuilds) - Returns an array of [builds](https://hathora.dev/docs/concepts/hathora-entities#build) for an [application](https://hathora.dev/docs/concepts/hathora-entities#application).\n* [runBuild](docs/sdks/buildv1/README.md#runbuild) - Builds a game server artifact from a tarball you provide. Pass in the `buildId` generated from [`CreateBuild()`](https://hathora.dev/api#tag/BuildV1/operation/CreateBuild).\n\n### [deploymentV1](docs/sdks/deploymentv1/README.md)\n\n* [createDeployment](docs/sdks/deploymentv1/README.md#createdeployment) - Create a new [deployment](https://hathora.dev/docs/concepts/hathora-entities#deployment). Creating a new deployment means all new rooms created will use the latest deployment configuration, but existing games in progress will not be affected.\n* [getDeploymentInfo](docs/sdks/deploymentv1/README.md#getdeploymentinfo) - Get details for a [deployment](https://hathora.dev/docs/concepts/hathora-entities#deployment).\n* [getDeployments](docs/sdks/deploymentv1/README.md#getdeployments) - Returns an array of [deployments](https://hathora.dev/docs/concepts/hathora-entities#deployment) for an [application](https://hathora.dev/docs/concepts/hathora-entities#application).\n\n### [discoveryV1](docs/sdks/discoveryv1/README.md)\n\n* [getPingServiceEndpoints](docs/sdks/discoveryv1/README.md#getpingserviceendpoints) - Returns an array of all regions with a host and port that a client can directly ping. Open a websocket connection to `wss://\u003chost\u003e:\u003cport\u003e/ws` and send a packet. To calculate ping, measure the time it takes to get an echo packet back.\n\n### [lobbyV1](docs/sdks/lobbyv1/README.md)\n\n* [~~createPrivateLobbyDeprecated~~](docs/sdks/lobbyv1/README.md#createprivatelobbydeprecated) - :warning: **Deprecated**\n* [~~createPublicLobbyDeprecated~~](docs/sdks/lobbyv1/README.md#createpubliclobbydeprecated) - :warning: **Deprecated**\n* [~~listActivePublicLobbiesDeprecatedV1~~](docs/sdks/lobbyv1/README.md#listactivepubliclobbiesdeprecatedv1) - :warning: **Deprecated**\n\n### [lobbyV2](docs/sdks/lobbyv2/README.md)\n\n* [~~createLobbyDeprecated~~](docs/sdks/lobbyv2/README.md#createlobbydeprecated) - Create a new lobby for an [application](https://hathora.dev/docs/concepts/hathora-entities#application). A lobby object is a wrapper around a [room](https://hathora.dev/docs/concepts/hathora-entities#room) object. With a lobby, you get additional functionality like configuring the visibility of the room, managing the state of a match, and retrieving a list of public lobbies to display to players. :warning: **Deprecated**\n* [~~createLocalLobby~~](docs/sdks/lobbyv2/README.md#createlocallobby) - :warning: **Deprecated**\n* [~~createPrivateLobby~~](docs/sdks/lobbyv2/README.md#createprivatelobby) - :warning: **Deprecated**\n* [~~createPublicLobby~~](docs/sdks/lobbyv2/README.md#createpubliclobby) - :warning: **Deprecated**\n* [~~getLobbyInfo~~](docs/sdks/lobbyv2/README.md#getlobbyinfo) - Get details for a lobby. :warning: **Deprecated**\n* [~~listActivePublicLobbiesDeprecatedV2~~](docs/sdks/lobbyv2/README.md#listactivepubliclobbiesdeprecatedv2) - Get all active lobbies for a an [application](https://hathora.dev/docs/concepts/hathora-entities#application). Filter by optionally passing in a `region`. Use this endpoint to display all public lobbies that a player can join in the game client. :warning: **Deprecated**\n* [~~setLobbyState~~](docs/sdks/lobbyv2/README.md#setlobbystate) - Set the state of a lobby. State is intended to be set by the server and must be smaller than 1MB. Use this endpoint to store match data like live player count to enforce max number of clients or persist end-game data (i.e. winner or final scores). :warning: **Deprecated**\n\n### [lobbyV3](docs/sdks/lobbyv3sdk/README.md)\n\n* [createLobby](docs/sdks/lobbyv3sdk/README.md#createlobby) - Create a new lobby for an [application](https://hathora.dev/docs/concepts/hathora-entities#application). A lobby object is a wrapper around a [room](https://hathora.dev/docs/concepts/hathora-entities#room) object. With a lobby, you get additional functionality like configuring the visibility of the room, managing the state of a match, and retrieving a list of public lobbies to display to players.\n* [getLobbyInfoByRoomId](docs/sdks/lobbyv3sdk/README.md#getlobbyinfobyroomid) - Get details for a lobby.\n* [getLobbyInfoByShortCode](docs/sdks/lobbyv3sdk/README.md#getlobbyinfobyshortcode) - Get details for a lobby. If 2 or more lobbies have the same `shortCode`, then the most recently created lobby will be returned.\n* [listActivePublicLobbies](docs/sdks/lobbyv3sdk/README.md#listactivepubliclobbies) - Get all active lobbies for a given [application](https://hathora.dev/docs/concepts/hathora-entities#application). Filter the array by optionally passing in a `region`. Use this endpoint to display all public lobbies that a player can join in the game client.\n\n### [logV1](docs/sdks/logv1/README.md)\n\n* [~~getLogsForApp~~](docs/sdks/logv1/README.md#getlogsforapp) - Returns a stream of logs for an [application](https://hathora.dev/docs/concepts/hathora-entities#application) using `appId`. :warning: **Deprecated**\n* [~~getLogsForDeployment~~](docs/sdks/logv1/README.md#getlogsfordeployment) - Returns a stream of logs for a [deployment](https://hathora.dev/docs/concepts/hathora-entities#deployment) using `appId` and `deploymentId`. :warning: **Deprecated**\n* [getLogsForProcess](docs/sdks/logv1/README.md#getlogsforprocess) - Returns a stream of logs for a [process](https://hathora.dev/docs/concepts/hathora-entities#process) using `appId` and `processId`.\n\n### [managementV1](docs/sdks/managementv1/README.md)\n\n* [sendVerificationEmail](docs/sdks/managementv1/README.md#sendverificationemail)\n\n### [metricsV1](docs/sdks/metricsv1/README.md)\n\n* [getMetrics](docs/sdks/metricsv1/README.md#getmetrics) - Get metrics for a [process](https://hathora.dev/docs/concepts/hathora-entities#process) using `appId` and `processId`.\n\n### [processesV1](docs/sdks/processesv1/README.md)\n\n* [getProcessInfo](docs/sdks/processesv1/README.md#getprocessinfo) - Get details for a [process](https://hathora.dev/docs/concepts/hathora-entities#process).\n* [getRunningProcesses](docs/sdks/processesv1/README.md#getrunningprocesses) - Retrieve 10 most recently started [process](https://hathora.dev/docs/concepts/hathora-entities#process) objects for an [application](https://hathora.dev/docs/concepts/hathora-entities#application). Filter the array by optionally passing in a `region`.\n* [getStoppedProcesses](docs/sdks/processesv1/README.md#getstoppedprocesses) - Retrieve 10 most recently stopped [process](https://hathora.dev/docs/concepts/hathora-entities#process) objects for an [application](https://hathora.dev/docs/concepts/hathora-entities#application). Filter the array by optionally passing in a `region`.\n\n### [roomV1](docs/sdks/roomv1/README.md)\n\n* [~~createRoomDeprecated~~](docs/sdks/roomv1/README.md#createroomdeprecated) - :warning: **Deprecated**\n* [~~destroyRoomDeprecated~~](docs/sdks/roomv1/README.md#destroyroomdeprecated) - :warning: **Deprecated**\n* [~~getActiveRoomsForProcessDeprecated~~](docs/sdks/roomv1/README.md#getactiveroomsforprocessdeprecated) - :warning: **Deprecated**\n* [~~getConnectionInfoDeprecated~~](docs/sdks/roomv1/README.md#getconnectioninfodeprecated) - :warning: **Deprecated**\n* [~~getInactiveRoomsForProcessDeprecated~~](docs/sdks/roomv1/README.md#getinactiveroomsforprocessdeprecated) - :warning: **Deprecated**\n* [~~getRoomInfoDeprecated~~](docs/sdks/roomv1/README.md#getroominfodeprecated) - :warning: **Deprecated**\n* [~~suspendRoomDeprecated~~](docs/sdks/roomv1/README.md#suspendroomdeprecated) - :warning: **Deprecated**\n\n### [roomV2](docs/sdks/roomv2/README.md)\n\n* [createRoom](docs/sdks/roomv2/README.md#createroom) - Create a new [room](https://hathora.dev/docs/concepts/hathora-entities#room) for an existing [application](https://hathora.dev/docs/concepts/hathora-entities#application). Poll the [`GetConnectionInfo()`](https://hathora.dev/api#tag/RoomV2/operation/GetConnectionInfo) endpoint to get connection details for an active room.\n* [destroyRoom](docs/sdks/roomv2/README.md#destroyroom) - Destroy a [room](https://hathora.dev/docs/concepts/hathora-entities#room). All associated metadata is deleted.\n* [getActiveRoomsForProcess](docs/sdks/roomv2/README.md#getactiveroomsforprocess) - Get all active [rooms](https://hathora.dev/docs/concepts/hathora-entities#room) for a given [process](https://hathora.dev/docs/concepts/hathora-entities#process).\n* [getConnectionInfo](docs/sdks/roomv2/README.md#getconnectioninfo) - Poll this endpoint to get connection details to a [room](https://hathora.dev/docs/concepts/hathora-entities#room). Clients can call this endpoint without authentication.\n* [getInactiveRoomsForProcess](docs/sdks/roomv2/README.md#getinactiveroomsforprocess) - Get all inactive [rooms](https://hathora.dev/docs/concepts/hathora-entities#room) for a given [process](https://hathora.dev/docs/concepts/hathora-entities#process).\n* [getRoomInfo](docs/sdks/roomv2/README.md#getroominfo) - Retreive current and historical allocation data for a [room](https://hathora.dev/docs/concepts/hathora-entities#room).\n* [suspendRoom](docs/sdks/roomv2/README.md#suspendroom) - Suspend a [room](https://hathora.dev/docs/concepts/hathora-entities#room). The room is unallocated from the process but can be rescheduled later using the same `roomId`.\n* [updateRoomConfig](docs/sdks/roomv2/README.md#updateroomconfig)\n\u003c!-- End SDK Available Operations --\u003e\n\n\u003c!-- Start Global Parameters --\u003e\n## Global Parameters\n\nA 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.\n\nFor 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 `deleteApp`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.\n\n\n### Available Globals\n\nThe following global parameter is available.\n\n| Name | Type | Required | Description |\n| ---- | ---- |:--------:| ----------- |\n| appId | string |  | The appId parameter. |\n\n\n### Example\n\n```typescript\nimport { HathoraCloud } from \"@speakeasy-sdks/hathora-sdk-typescript\";\n\nasync function run() {\n  const sdk = new HathoraCloud({\n      security: {\n        hathoraDevToken: \"\",\n      },\n      appId: \"app-af469a92-5b45-4565-b3c4-b79878de67d2\",\n    });\n\n  const appId = \"app-af469a92-5b45-4565-b3c4-b79878de67d2\";\n  const res = await sdk.appV1.deleteApp(appId);\n\n  if (res?.statusCode !== 200) {\n    throw new Error(\"Unexpected status code: \" + res?.statusCode || \"-\");\n  }\n  \n  // handle response\n}\n\nrun();\n```\n\u003c!-- End Global Parameters --\u003e\n\n\u003c!-- Start Error Handling --\u003e\n## Error Handling\n\nAll 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.\n\n| Error Object    | Status Code     | Content Type    |\n| --------------- | --------------- | --------------- |\n| models.SDKError | 400-600         | */*             |\n\nExample\n\n```typescript\nimport { HathoraCloud } from \"@speakeasy-sdks/hathora-sdk-typescript\";\nimport * as errors from \"@speakeasy-sdks/hathora-sdk-typescript/models\";\n\nasync function run() {\n  const sdk = new HathoraCloud({\n      security: {\n        hathoraDevToken: \"\",\n      },\n      appId: \"app-af469a92-5b45-4565-b3c4-b79878de67d2\",\n    });\n\n  \n  \n  const res = await sdk.appV1.createApp({\n      appName: \"minecraft\",\n      authConfiguration: {\n        anonymous: {},\n        google: {\n          clientId: \"string\",\n        },\n        nickname: {},\n      },\n    })\n    .catch((err) =\u003e {\n      throw err;\n    });\n\n  if (res?.statusCode !== 200) {\n    throw new Error(\"Unexpected status code: \" + res?.statusCode || \"-\");\n  }\n  \n  // handle response\n}\n\nrun();\n```\n\u003c!-- End Error Handling --\u003e\n\n\u003c!-- Start Server Selection --\u003e\n## Server Selection\n\n### Select Server by Index\n\nYou can override the default server globally by passing a server index to the `serverIdx: number` 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:\n\n| # | Server | Variables |\n| - | ------ | --------- |\n| 0 | `https://api.hathora.dev` | None |\n| 1 | `https:///` | None |\n\n#### Example\n\n```typescript\nimport { HathoraCloud } from \"@speakeasy-sdks/hathora-sdk-typescript\";\n\nasync function run() {\n  const sdk = new HathoraCloud({\n      serverIdx: 1,\n      security: {\n        hathoraDevToken: \"\",\n      },\n      appId: \"app-af469a92-5b45-4565-b3c4-b79878de67d2\",\n    });\n\n  \n  const res = await sdk.appV1.createApp({\n      appName: \"minecraft\",\n      authConfiguration: {\n        anonymous: {},\n        google: {\n          clientId: \"string\",\n        },\n        nickname: {},\n      },\n    });\n\n  if (res?.statusCode !== 200) {\n    throw new Error(\"Unexpected status code: \" + res?.statusCode || \"-\");\n  }\n  \n  // handle response\n}\n\nrun();\n```\n\n\n### Override Server URL Per-Client\n\nThe default server can also be overridden globally by passing a URL to the `serverURL: str` optional parameter when initializing the SDK client instance. For example:\n```typescript\nimport { HathoraCloud } from \"@speakeasy-sdks/hathora-sdk-typescript\";\n\nasync function run() {\n  const sdk = new HathoraCloud({\n      serverURL: \"https://api.hathora.dev\",\n      security: {\n        hathoraDevToken: \"\",\n      },\n      appId: \"app-af469a92-5b45-4565-b3c4-b79878de67d2\",\n    });\n\n  \n  const res = await sdk.appV1.createApp({\n      appName: \"minecraft\",\n      authConfiguration: {\n        anonymous: {},\n        google: {\n          clientId: \"string\",\n        },\n        nickname: {},\n      },\n    });\n\n  if (res?.statusCode !== 200) {\n    throw new Error(\"Unexpected status code: \" + res?.statusCode || \"-\");\n  }\n  \n  // handle response\n}\n\nrun();\n```\n\u003c!-- End Server Selection --\u003e\n\n\u003c!-- Start Custom HTTP Client --\u003e\n## Custom HTTP Client\n\nThe TypeScript SDK makes API calls using an `HTTPClient` that wraps the native\n[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This\nclient is a thin wrapper around `fetch` and provides the ability to attach hooks\naround the request lifecycle that can be used to modify the request or handle\nerrors and response.\n\nThe `HTTPClient` constructor takes an optional `fetcher` argument that can be\nused to integrate a third-party HTTP client or when writing tests to mock out\nthe HTTP client and feed in fixtures.\n\nThe following example shows how to use the `\"beforeRequest\"` hook to to add a\ncustom header and a timeout to requests and how to use the `\"requestError\"` hook\nto log errors:\n\n```typescript\nimport { HathoraCloud } from \"@speakeasy-sdks/hathora-sdk-typescript\";\nimport { HTTPClient } from \"@speakeasy-sdks/hathora-sdk-typescript/lib/http\";\n\nconst httpClient = new HTTPClient({\n  // fetcher takes a function that has the same signature as native `fetch`.\n  fetcher: (request) =\u003e {\n    return fetch(request);\n  }\n});\n\nhttpClient.addHook(\"beforeRequest\", (request) =\u003e {\n  const nextRequest = new Request(request, {\n    signal: request.signal || AbortSignal.timeout(5000);\n  });\n\n  nextRequest.headers.set(\"x-custom-header\", \"custom value\");\n\n  return nextRequest;\n});\n\nhttpClient.addHook(\"requestError\", (error, request) =\u003e {\n  console.group(\"Request Error\");\n  console.log(\"Reason:\", `${error}`);\n  console.log(\"Endpoint:\", `${request.method} ${request.url}`);\n  console.groupEnd();\n});\n\nconst sdk = new HathoraCloud({ httpClient });\n```\n\u003c!-- End Custom HTTP Client --\u003e\n\n\u003c!-- Start Authentication --\u003e\n\n## Authentication\n\n### Per-Client Security Schemes\n\nThis SDK supports the following security scheme globally:\n\n| Name              | Type              | Scheme            |\n| ----------------- | ----------------- | ----------------- |\n| `hathoraDevToken` | http              | HTTP Bearer       |\n\nYou can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example:\n```typescript\nimport { HathoraCloud } from \"@speakeasy-sdks/hathora-sdk-typescript\";\n\nasync function run() {\n  const sdk = new HathoraCloud({\n      security: {\n        hathoraDevToken: \"\",\n      },\n      appId: \"app-af469a92-5b45-4565-b3c4-b79878de67d2\",\n    });\n\n  \n  const res = await sdk.appV1.createApp({\n      appName: \"minecraft\",\n      authConfiguration: {\n        anonymous: {},\n        google: {\n          clientId: \"string\",\n        },\n        nickname: {},\n      },\n    });\n\n  if (res?.statusCode !== 200) {\n    throw new Error(\"Unexpected status code: \" + res?.statusCode || \"-\");\n  }\n  \n  // handle response\n}\n\nrun();\n```\n\n### Per-Operation Security Schemes\n\nSome operations in this SDK require the security scheme to be specified at the request level. For example:\n```typescript\nimport { HathoraCloud } from \"@speakeasy-sdks/hathora-sdk-typescript\";\nimport { CreatePrivateLobbyDeprecatedSecurity, Region } from \"@speakeasy-sdks/hathora-sdk-typescript/models\";\n\nasync function run() {\n  const sdk = new HathoraCloud({\n      appId: \"app-af469a92-5b45-4565-b3c4-b79878de67d2\",\n    });\n\n  const appId = \"app-af469a92-5b45-4565-b3c4-b79878de67d2\";\n  const local = false;\n  const region = Region.London;\n  const operationSecurity: CreatePrivateLobbyDeprecatedSecurity = {\n    playerAuth: \"\",\n  };\n  const res = await sdk.lobbyV1.createPrivateLobbyDeprecated(operationSecurity, appId, local, region);\n\n  if (res?.statusCode !== 200) {\n    throw new Error(\"Unexpected status code: \" + res?.statusCode || \"-\");\n  }\n  \n  // handle response\n}\n\nrun();\n```\n\u003c!-- End Authentication --\u003e\n\n\u003c!-- Placeholder for Future Speakeasy SDK Sections --\u003e\n\n# Development\n\n## Maturity\n\nThis SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage\nto a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally\nlooking for the latest version.\n\n## Contributions\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically.\nFeel 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!\n\n### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspeakeasy-sdks%2Fhathora-sdk-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspeakeasy-sdks%2Fhathora-sdk-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspeakeasy-sdks%2Fhathora-sdk-typescript/lists"}