npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

bgg-client

v2.1.0

Published

![NPM Version](https://img.shields.io/npm/v/bgg-client) ![NPM Downloads](https://img.shields.io/npm/dm/bgg-client) ![npm bundle size](https://img.shields.io/bundlephobia/min/bgg-client) ![GitHub License](https://img.shields.io/github/license/ghall89/bgg-c

Readme

🎲 bgg-client

NPM Version NPM Downloads npm bundle size GitHub License

A TypeScript client for working with the BoardGameGeek.com API.

To use bgg-client, you must get an API key, and accept BoardGameGeek.com's XML API Terms of Use.

Install

# npm
npm install bgg-client
# pnpm
pnpm add bgg-client
# yarn
yarn add bgg-client
# bun
bun add bgg-client

Usage

Import the BoardGameGeekClient class, and create a new instance of it with an API key.

import { BoardGameGeekClient } from 'bgg-client';
const bgg = new BoardGameGeekClient('your-api-key');

By default, there is a rate limit of 1 request every 5 seconds to comply with the BoardGameGeek API's suggested request rate.

For full manual access to any endpoint, you can use the lower-level ApiClient class. However, this is not fully supported, and you may have to provide your own types for full type safety.

Migration from v1 to v2

The default export has been removed. You must now import BoardGameGeekClient and provide an API key, as described above.

Methods

Search

search(query, options)

Calls the search endpoint to look up games by name. Returns an array of matching items, including board games, expansions, and other types. Supports options like type and exact.

Thing

thing(id, options)

Calls the thing endpoint to fetch detailed information about a game or item by its BGG ID. Supports options like stats to include game statistics.

Hot

hot(options)

Calls the hot endpoint to retrieve a list of trending or popular items. You can optionally specify a type (e.g., boardgame, rpg, boardgameperson) to filter results.

Family

family(id, options)

Calls the family endpoint to retrieve a "family", and an array of links to related things. You can optionally specify a type (e.g., boardgamefamily, rpg, rpgperiodical) to filter results.

User

user(name, options)

Calls the user endpoint to retrieve a "user" by their username, and their related stats. You can optionally include "buddies", "guilds", as well as the user's "top" and "hot" items

Guild

user(id, options)

Calls the guild endpoint to retrieve a "guild" by id. You can optionally include a list of users that belong to the guild.

Plays

plays(id, options)

Calls the plays endpoint to retrieve a list of "plays" by the id of a "thing" or "user".

Collection

user(username, options)

Calls the collection endpoint to retrieve a users collection by their username. Can be filtered using various options detailed here.

Forum List

forumList(id, options)

Calls the "forumlist" endpoint to retrieve a list of "forums" for a given "thing" by the thing id.

Forum

forum(id, options)

Calls the "forum" endpoint to retrieve a "forum", or list of "threads", by forum id.

Thread

thread(id, options)

Calls the "thread" endpoint to retrieve a forum "thread" by thread id.

Example

import { BoardGameGeekClient } from 'bgg-client';
const bgg = new BoardGameGeekClient('your-api-key');

try {
  const results = await bgg.search('Cascadia');
  const game = await bgg.thing('342942'); // Cascadia's BGG ID
  const hot = await bgg.hot();
} catch {
  // handle the error
}

Additional Info

Refer to the BGG XML API2 docs for documentation on all endpoints, and their options.

Dependencies