Jump to content


Photo

Set API KEY

node.js node-steam-tradeoffer-manager

  • Please log in to reply
2 replies to this topic

#1 Froxz

Froxz

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 30 December 2018 - 06:59 AM

Hi,

it is possible to set API?

Trade-offers:
 

this.apiKey = null;
this._community.getWebApiKey(this._domain, (err, key) => {
    if (err) {
        callback(err);
        return;
    }

    this.apiKey = key;
    callback();
});


I can make a pull request to change 

this.apiKey = (options.apiKey || null);

Or there is a reason for not giving option to pass api key?



#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,883 posts

Posted 31 December 2018 - 01:02 AM

Or there is a reason for not giving option to pass api key?

 

Yes, because ignorant coders will almost definitely start passing API keys that don't belong to the account they're signed into, and start posting GitHub issues asking what's going on.

 

If you know what you're doing, you can set the apiKey property directly with the correct key, but please make sure you actually know what you're doing.



#3 Froxz

Froxz

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 04 January 2019 - 04:50 PM

Yes, because ignorant coders will almost definitely start passing API keys that don't belong to the account they're signed into, and start posting GitHub issues asking what's going on.

 

If you know what you're doing, you can set the apiKey property directly with the correct key, but please make sure you actually know what you're doing.

 

Hi, thanks for reply, yes I ended up doing it directly:
 

user.on('webSession', function(sessionID, cookies) {

	console.log(data.login+': Got webSession');

	manager.apiKey = data.api_key;

	manager.setCookies(cookies, function(err) {});

	community.setCookies(cookies);
});

Yes, I manually generate the API KEY (Because I use same KEY for LOGIN) just less request and hassle because I know the API KEY.

Thank you.







Also tagged with one or more of these keywords: node.js, node-steam-tradeoffer-manager

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users