TypeScript SDK
Call the SteamSets API from TypeScript or JavaScript with typed requests, typed responses, and built-in pagination.
@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 has a method with the same name.
Install
npm install @steamsets/client-tspnpm add @steamsets/client-tsyarn add @steamsets/client-tsbun add @steamsets/client-tsnub add @steamsets/client-tsaube add @steamsets/client-tsCreate a client
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 body.
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 has cURL and Python samples that you can copy.