@valapi/auth
v5.0.0-beta.3
Published
Valorant API - Authentication
Downloads
71
Maintainers
Readme
Valorant API - Authentication
Valorant Authentication
Documentation: valapi.github.io/docs
Guide: valapi.github.io/guide
- @valapi/auth isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.
- @valapi/auth was created under Riot Games' "Legal Jibber Jabber" policy using assets owned by Riot Games. Riot Games does not endorse or sponsor this project.
- MIT License
Installation
NPM:
npm install @valapi/auth
PNPM:
pnpm add @valapi/auth
Guide
import { Auth } from "@valapi/auth";
const auth = new Auth();
Captcha
This is only an example function
const data = await auth.captcha();
const captchaResponse = await getCaptchaResponse(data); // P1_eyJ...
Auth
await auth.login({
username: "BestUsername",
password: "SuperSecretPassword",
captcha: captchaResponse
});
if (auth.isMultifactor) {
const loginCode = 428793;
await auth.multifactor(loginCode);
}
Subject (PlayerUUID)
const subject = auth.subject;
Serialize
const auth = new Auth({ user: oldAuth.toJSON() });
if (!auth.isAuthenticated) {
await auth.reauthorize();
}