npm

Share private packages across your team with npm Orgs, now with simplified billing via the aws marketplace!Learn more »

siegegg-api

1.1.0 • Public • Published

SiegeGG API

This package is a small library built for interation with the SiegeGG API. The package features full support for community and enterprise features. You can find details on the API here.

Usage

Before you start using this library, you need to register a SiegeGG account, if you have not already one, and then create an API application at the dev hub. There you will obtain an API token that authorizes your application.

const { SiegeGGApiClient } = require('siegegg-api');
 
const api = new SiegeGGApiClient({
    // replace a_random_token with your obtained API token
    token: 'a_random_token',
});
 
// using Promises
 
api.player('PENGU').then(player => console.log(player.nationality)); // Denmark
 
api.basic()
    .news()
    .then(articles => {
        let authors = articles.data.map(article => article.author);
        console.log(authors); // [TheRussianEwok, Boxi, ChankaNewsNetwork, ...]
    });
 
// or using async/await
 
let player = await app.player('PENGU');
console.log(player.nationality); // Denmark
 
let articles = await app.basic().news();
let authors = articles.data.map(article => article.author);
console.log(authors); // [TheRussianEwok, Boxi, ChankaNewsNetwork, ...]

License

AGPL-v3.0

Keywords

none

install

npm i siegegg-api

Downloadsweekly downloads

1

version

1.1.0

license

AGPL-3.0

homepage

gitlab.com

repository

Gitgitlab

last publish

collaborators

  • avatar
Report a vulnerability