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 🙏

© 2024 – Pkg Stats / Ryan Hefner

boardgamegeekclient

v1.9.1

Published

Javascript client to interact with BoardGameGeek public XML API

Downloads

142

Readme

GitHub Workflow Status (branch) GitHub release (latest by date)

boardgamegeekclient

It's a wrapper around the offcial boardgamegeek V2 API, with the scope to create a more confortable way to interact with them since they are exposed in XML format.
With this package you can create your own web app or integrate your backend for example.

Key features

  • :ballot_box_with_check: Fully typed requests and responses
  • :ballot_box_with_check: Easy to use
  • :ballot_box_with_check: Typescript written
  • :ballot_box_with_check: Promisified
  • :ballot_box_with_check: thing, family, forum, thread, user, guild, play, collection endpoints

Installation

npm i boardgamegeekclient
yarn add boardgamegeekclient

Usage

In Node.js (commonjs) environment

const { BggClient } = require("boardgamegeekclient");

In ES environment

import { BggClient } from 'boardgamegeekclient';

Initialize BggClient and get singleton instance

const client = BggClient.Create();

API

Interact with boardgamegeek entities using the corresponding client object and fire a request with query or queryWithProgress method.

Thing

Get boardgame, boardgame expansion, boardgame accessory, videogame, rpgitem, rpgissue informations.
Thing client expose query and queryWithProgress.

Examples

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 });

Family

Get rpg, rpgperiodical, boardgamefamily informations.
Family client expose query and queryWithProgress.

Examples

const families = await client.family.query({ id: [174430, 35421] });

Forum List

Get a list of forums
(in boardgame or family page (of the id), forums tab, left sidebars with all forums).
ForumList client expose query and queryWithProgress.

Examples

const forumlists: BggForumlistDto[] = await client.forumlist.query({ id: [8374,22184,59218,1029,2076], type: ['family']});

Forum

Get a single forum.

Examples

const forum = await client.forum.query({ id: 19, page: 3 });

Thread

Get a single thread.

Examples

const threads: BggThreadDto[] = await client.thread.query({ id: 2571698, minarticledate: '2021-01-03', count: 15 });

User

Get public profile information about a user by username.

Examples

const users: BggUserDto[] = await client.user.query({ name: 'mattiabanned', hot: 1, top: 1 });

Guild

Get a single guild.

Examples

const guilds: BggGuildDto[] = await client.guild.query({ id: 1000, members: 1, sort: 'date', page: 1 });

Play

Request plays logged by a particular user or for a particular item.

Examples

const plays: BggPlayDto[] = await client.play.query({ username: 'mattiabanned' });

Collection

Examples

const collections: BggCollectionDto[]  = await client.collection.query({ username: 'mattiabanned', excludesubtype: ["boardgameaccessory"] });