Here's a little demo just in case anybody else curious about rate limits.
'use strict';
const
SteamCommunity = require('steamcommunity'),
SteamTotp = require('steam-totp'),
COMMUNITY = new SteamCommunity();
const
USERNAME = '...',
PASSWORD = '...',
SHARED_SECRET = '...',
IDENTITY_SECRET = '...',
CODE = SteamTotp.getAuthCode(SHARED_SECRET),
INTERVAL = 5000;
COMMUNITY.login({
accountName: USERNAME,
password: PASSWORD,
twoFactorCode: CODE
}, function(err, sessionID, cookies, steamguard, oAuthToken){
if (err) {
console.log('login ERROR:', err);
return;
}
COMMUNITY.setCookies(cookies);
let n = 0;
const onInterval = function () {
n += 1;
const time = Math.round(Date.now() / 1000);
const key = SteamTotp.getConfirmationKey(IDENTITY_SECRET, time, 'conf');
COMMUNITY.getConfirmations(time, key, function (err, confirmations) {
if (err) {
console.log(`${n}: getConfirmations ERROR:`, err);
return;
}
console.log(`${n}: getConfirmations OK`);
});
};
setInterval(onInterval, INTERVAL);
});
INTERVAL === 10000
1: getConfirmations OK
2: getConfirmations OK
3: getConfirmations OK
4: getConfirmations OK
5: getConfirmations OK
6: getConfirmations OK
7: getConfirmations OK
8: getConfirmations OK
9: getConfirmations OK
INTERVAL === 5000
1: getConfirmations OK
2: getConfirmations OK
3: getConfirmations OK
4: getConfirmations OK
5: getConfirmations OK
6: getConfirmations OK
7: getConfirmations ERROR: { [Error: HTTP error 429] code: 429 }
8: getConfirmations ERROR: { [Error: HTTP error 429] code: 429 }
9: getConfirmations ERROR: { [Error: HTTP error 429] code: 429 }