0.0.1 • Published 7 years ago
steamjs v0.0.1
SteamJS
Javascript access to the Steam Community API
Initialize
This module uses dotenv
, so you can set the ENV variable STEAM_API_KEY.
If you do not use a .env file, you can set the apiKey manually:
With dotenv
import Steam from 'steamjs';
const steamClient = new Steam();
Default
import Steam from 'steamjs';
const steamClient = new Steam({ apiKey: '1234ASDF' });
API
getPlayerSummaries(steamIds)
Returns Promise
Note: the Player API is documented in the wiki.
Usage
let players = await getPlayerSummaries('1234,5678');
players.forEach((player) => console.log(player.name()));
or
getPlayerSummaries('1234').then((players) => {
players.forEach((player) => console.log(player.name()));
});
0.0.1
7 years ago