Javascript access to the Steam Community API
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:
import Steam from 'steamjs';
const steamClient = new Steam();
import Steam from 'steamjs';
const steamClient = new Steam({ apiKey: '1234ASDF' });
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()));
});