@sulphate/steamlogin
v1.1.1
Published
Simple wrapper for Dr. McKay's steamcommunity and steam-tradeoffer-manager packages to set things up.
Downloads
72
Readme
A simple wrapper around Dr. McKay's steammcommunity and steam-tradeoffer-manager NPM packages to create a single-method log-on system for multiple Steam accounts.
Installation
npm install @sulphate/steamlogin
About
This package will most likely not be useful to you, it's very specific and made mostly for personal convenience uses. It logs into Steam using a given accounts file, and sets up a trade manager for each one, all with one line. It uses McKay's steamcommunity, steam-totp and steam-tradeoffer-manager packages.
Usage
- Create a file called
accounts.json
in your project root folder. - The format of the file should be as follows:
{
"accounts": [
{
"accountName": "Steam Username",
"password": "Password",
"sharedSecret": "Shared Secret",
"identitySecret": "Optional Identity Secret"
}
]
}
Note: The identity secret will be added to the returned object for each account, which can be used to confirm trade offers and other confirmations.
- Require/import the package:
// ES6
import SteamLogin from "@sulphate/steamlogin";
// ES5
const SteamLogin = require("@sulphate/steamlogin");
- Call the SteamLogin#login() function to log in to your Steam accounts. A promise is returned as this function is asynchronous
// Async/Await
let loggedInAccounts = await SteamLogin.login();
// Promises
SteamLogin.login().then(accounts => {
// Do something with the accounts.
}, err => {
// Handle the error.
});
The returned object contains the logged-in
steamcommunity
andsteam-tradeoffer-manager
instances, accessible by the account name that it corresponds to.The community instance is under
accounts[accountName].community
, and the manager instance is underaccounts[accountName].manager
. The identity secret is the same, but.identitySecret
.Finally, you can pass in an instance of
coloured-logger
(package) and it will use it instead of default console logging.