Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including siegegg-api with all npm packages installed. Try it out:

var siegeggApi = require("siegegg-api")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

siegegg-api v1.1.0

This package is a small library built for interation with the [SiegeGG](https://siege.gg/) API. The package features full support for community and enterprise features. You can find details on the API [here](https://dev.siege.gg/docs/1.0/preamble).

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

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free