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

    Keywords

    none

    Install

    npm i siegegg-api

    DownloadsWeekly Downloads

    0

    Version

    1.1.0

    License

    AGPL-3.0

    Unpacked Size

    52.6 kB

    Total Files

    5

    Last publish

    Collaborators

    • kevslashnull