---
title: TypeScript SDK
description: Call the SteamSets API from TypeScript or JavaScript with typed requests, typed responses, and built-in pagination.
sidebar:
  icon: package
  order: 6
---

`@steamsets/client-ts` is the official TypeScript SDK. We generate it from the same OpenAPI spec as this reference, so each endpoint in the [API reference](/reference) has a method with the same name.

## Install

```package-install
npm install @steamsets/client-ts
```

## Create a client

```ts
import { SteamSets } from '@steamsets/client-ts';

const steamsets = new SteamSets({ token: process.env.STEAMSETS_API_KEY });
```

The endpoint name tells you the method: `account.getInfo` is `steamsets.account.getInfo()`, and `leaderboard.getAccountLeaderboard` is `steamsets.leaderboard.getAccountLeaderboard()`.

## Handle errors

The SDK throws a `SteamSetsError` for each non-`2xx` response. The error has the HTTP response and the raw [problem details](/errors) body.

```ts
import { SteamSetsError } from '@steamsets/client-ts/models/errors';

try {
  await steamsets.account.getInfo({ id: { steamId64: '76561199176433616' } });
} catch (error) {
  if (error instanceof SteamSetsError) {
    console.error(error.httpMeta.response.status, error.httpMeta.body);
  }
  throw error;
}
```

## Other languages

There is no official SDK for other languages yet. The API is plain JSON over HTTPS, so any HTTP client works. Each page in the [API reference](/reference) has cURL and Python samples that you can copy.
