This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

siegegg-api
TypeScript icon, indicating that this package has built-in type declarations

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

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i siegegg-api

    Weekly Downloads

    1

    Version

    1.1.0

    License

    AGPL-3.0

    Unpacked Size

    52.6 kB

    Total Files

    5

    Last publish

    Collaborators

    • kevslashnull