DEPRECATED
This package has been deprecated.
It's been versioned really badly and also missed some important points so now this repository served as a base for new package: bgg-xml-api-client.
BGG2JSON
It's a simple library providing just a single function that returns requested BGG data as a JavaScript object.
It uses axios under the hood, so the return value is wrapped with AxiosResponse
- just to provide all the data about the response from API.
The main data sits in data
property of that response object.
Example usage:
import bgg2json from 'bgg2json';
const { data } = await bgg2json('user', { name: 'Qrzy88' });
console.log(data.id); // displays: 1381959
bgg2json
takes 2 parameters:
- BGG API resource name
- resource parameters as object - for better DX the parameters are typed, but the type is a union of types given to the wrappers listed below
Wrappers
There are also wrappers available for certain resources that accept params (already typed) as the only argument:
getBggCollection(params)
getBggFamily(params)
getBggForum(params)
getBggForumlist(params)
getBggGeeklist(params)
getBggGuild(params)
getBggHot(params)
getBggPlays(params)
getBggSearch(params)
getBggThing(params)
getBggThread(params)
getBggUser(params)