0.1.0 • Published 7 years ago
js-steam-inventory v0.1.0
Get Steam user inventory
This is another node wrapper for fetching user Steam inventory.
Main properties of this module is its simpilicity and async support.
Also this module uses new Steam end-point and not the old one.
https://steamcommunity.com/inventory/<STEAM_ID>/<APP_ID>/<CONTEXT_Id>/
Install
using npm:
$ npm install --save js-steam-inventory
using yarn:
$ yarn add js-steam-inventory
Usage
const SteamInventory = require('js-steam-inventory');
steamInventory = new SteamInventory(USER_STEAM_ID);
// Simple example
// Inventory has two arguments. app id and context id.
// Inventory will return csgo items as default if you dont specify an app id
steamInventory.inventory()
.then(items => console.log(items))
.catch(error => console.log(error));
// Async/await supported
async () => {
try {
const items = await steamInventory.inventory();
console.log(items);
} catch(error) {
console.log(error);
}
};
API
inventory
Returns user Steam inventory by app id.
appId
Type: number
Default: 730
- AppID of the game you want the inventory of.
contextId
Type: number
Default: 2
- A way to organize/categorize items/assets/currency.
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