
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
bgg-ts-client
Advanced tools
Fully typed TypeScript client for the BoardGameGeek XMLv2 API with error handling and pagination support
A TypeScript client for the official BoardGameGeek XML API v2.
Note: This project is a fork of boardgamegeekclient by learningprocesss. It is now developed and maintained independently.

Starting in Fall 2025, BoardGameGeek requires all API clients to use authorization. Before using this package, you must register your application on BoardGameGeek and obtain an access token.
Register and manage your application here: https://boardgamegeek.com/applications
npm i bgg-ts-client
yarn add bgg-ts-client
In Node.js (commonjs) environment
const { BggClient } = require("bgg-ts-client");
In ES environment
import { BggClient } from 'bgg-ts-client';
Initialize BggClient and get singleton instance
const client = BggClient.Create({ apiKey: 'YOUR_API_KEY' });
Interact with boardgamegeek entities using the corresponding client object and fire a request with query or queryWithProgress method.
Get boardgame, boardgame expansion, boardgame accessory, videogame, rpgitem, rpgissue information. Thing client exposes query and queryWithProgress.
const things: BggThingDto[] = await client.thing.query({ id: [174430, 35421],
videos: 1,
comments: 1,
marketplace: 1,
stats: 1,
type: "boardgame" });
// with progress handler as parameter
await client.thing.queryWithProgress({
id: [250621, 257668, 226255, 340790, 279307, 279306, 345121, 271447, 187104, 253618, 271512, 432, 68448, 173346, 346703, 302260, 239472, 172818, 231398, 202408, 267814, 267813, 191189, 267127, 281946, 264647, 2272, 230085, 31260, 247367, 256442, 161970, 6249, 181293],
videos: 1,
comments: 1,
marketplace: 1,
stats: 1,
type: "boardgame"
}, { limit: 10 }, _data => {
});
// with progress handler registered on the client itself
client.thing.progressHandler = (_data) => { };
await client.thing.queryWithProgress({
id: [250621, 257668, 226255, 340790, 279307, 279306, 345121, 271447, 187104, 253618, 271512, 432, 68448, 173346, 346703, 302260, 239472, 172818, 231398, 202408, 267814, 267813, 191189, 267127, 281946, 264647, 2272, 230085, 31260, 247367, 256442, 161970, 6249, 181293],
videos: 1,
comments: 1,
marketplace: 1,
stats: 1,
type: "boardgame"
}, { limit: 10 });
Get rpg, rpgperiodical, boardgamefamily information. Family client exposes query and queryWithProgress.
const families = await client.family.query({ id: [174430, 35421] });
Get a list of forums (in boardgame or family page (of the id), forums tab, left sidebars with all forums). ForumList client exposes query and queryWithProgress.
const forumlists: BggForumlistDto[] = await client.forumlist.query({ id: [8374,22184,59218,1029,2076], type: ['family']});
Get a single forum.
const forum = await client.forum.query({ id: 19, page: 3 });
Get a single thread.
const threads: BggThreadDto[] = await client.thread.query({ id: 2571698, minarticledate: '2021-01-03', count: 15 });
Get public profile information about a user by username.
const users: BggUserDto[] = await client.user.query({ name: 'mattiabanned', hot: 1, top: 1 });
Get a single guild.
const guilds: BggGuildDto[] = await client.guild.query({ id: 1000, members: 1, sort: 'date', page: 1 });
Request plays logged by a particular user or for a particular item.
const plays: BggPlayDto[] = await client.play.query({ username: 'mattiabanned' });
Request the collection of a particular user.
const collections: BggCollectionDto[] = await client.collection.query({ username: 'mattiabanned', excludesubtype: ["boardgameaccessory"] });
All errors thrown by the client are wrapped in a BggClientError, which includes the endpoint name and the underlying cause. You can inspect the cause to determine whether the failure was an HTTP error or a parse error.
BggClientError — wraps all errors; includes endpoint and causeBggApiError — HTTP failures; includes statusCode and urlBggParseError — XML/DTO parse failures; includes truncated rawDataimport { BggClient, BggClientError, BggApiError, BggParseError } from 'bgg-ts-client';
const client = BggClient.Create({ apiKey: 'YOUR_API_KEY' });
try {
const things = await client.thing.query({ id: [174430], type: 'boardgame' });
} catch (error) {
if (error instanceof BggClientError) {
console.log(error.endpoint); // e.g. "thing"
if (error.cause instanceof BggApiError) {
console.log(error.cause.statusCode); // e.g. 500
console.log(error.cause.url);
}
if (error.cause instanceof BggParseError) {
console.log(error.cause.rawData); // truncated to 500 chars
}
}
}
FAQs
Fully typed TypeScript client for the BoardGameGeek XMLv2 API with error handling and pagination support
We found that bgg-ts-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.