danielwerg / r6api.js

🍫 Node.js wrapper around Rainbow Six Siege APIs
https://npm.im/r6api.js
MIT License
111 stars 19 forks source link

Error: 401 Invalid credentials #86

Closed LillieH1000 closed 2 years ago

LillieH1000 commented 2 years ago

Hello, no matter what I seem to do I always get invalid creditidentals for this api, I provided my basic code below, I did put in my actual ubisoft account info in the actual code but in the example I removed it.


const r6api = new R6API("email", "password");
const username = 'Daniel.Nt';
const platform = 'uplay';
const player = await r6api.findByUsername(platform, username);
const stats = await r6api.getStats(platform, player.id);
return stats.pvp.general.matches;
danielwerg commented 2 years ago

What version are you on?

In the latest versions R6API constructor only accepts one parameter - object. See: https://github.com/danielwerg/r6api.js#constructor

Replace:

const r6api = new R6API("email", "password");

With:

const r6api = new R6API({ email: "EMAILGOESHERE", password: "PASSWORDGOESHERE" });

Note for myself: Add issue templates, allow only bug reports and feature requests?, redirect rest to discord (also github discussions or just make another issue template for help related issues)?

LillieH1000 commented 2 years ago

Oh, thank you, I thought the object was just because of the dotenv, my bad.