0.1.0 • Published 6 years ago

js-steam-api v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

Async Steam web API wrapper

Another wrapper arround Steam API. Supports promises and ES6 async/await. This module requires a Steam web API key which you can obtain from HERE.

Install

using npm:

$ npm install --save js-steam-api

using yarn:

$ yarn add js-steam-api

Usage

const Steam = require('js-steam-api');

const option = {
    apiKey: YOUR_STEAM_API_KEY
}
const steam = new Steam(option);

// simple usage. get a single user summeries.
steam.GetPlayerSummaries({ steamIds: "steamId"})
    .then(res => console.log(res.data))
    .catch(err => console.log(err));

// or multiple users at a single request
steam.GetPlayerSummaries({ steamIds: ["steamId1", "steamId2"]})
    .then(res => console.log(res.data))
    .catch(err => console.log(err));

// also async/await supported
async () => {
    try {
        const response = await steam.GetPlayerSummaries({ steamIds: "steamId"});
        console.log(response.data);
    } catch(error) {
        console.log(error);
    }
};

API

constructor

  • Construct a new Steam instance
  • Has a setting object as argument that contains

For simpilicity and Resemblance every methods has a single object as argument . In the documentaions we describe the object properties.

ISteamUser

  • ResolveVanityURL

    • vanityUrl
      • Type: string
      • The vanity URL to get a SteamID for
      • Required
  • GetUserGroupList

    • steamId
      • Type: string
      • User Steam id to get user group list
      • Required
  • GetPlayerBans

    • steamIds
      • Type: string or array of string
      • Users Steam id to get Steam ban status
      • can be a single id or array of ids for getting multiple users ban status at a single request
      • Required
  • GetFriendList

    • steamId
      • Type: string
      • User Steam id to get user friend list
      • Required
  • GetPlayerSummaries

    • steamIds
      • Type: string or array of string
      • Users Steam id to get Steam summeries
      • can be a single id or array of ids for getting multiple users summeries at a single request
      • Required
    • version
      • Type: string
      • Should be one of v1 or v2.
      • Value is v1
      • Optional

Contributing

If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.

License

This project is licensed under the MIT License - see the LICENSE file for details

0.1.0

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago