npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@windowsedd/valorant-api

v1.0.0

Published

Unofficial NodeJS library for the VALORANT APIs used in game.

Downloads

30

Readme

@windowsed1225/valorant-api

Unofficial TypeScript/Node.js library for the VALORANT in-game APIs and the Riot XMPP social layer.

npm version License: MIT


Table of Contents


Installation

npm install @windowsed1225/valorant-api
# or
bun add @windowsed1225/valorant-api

Quick Start

import { API } from "@windowsedd/valorant-api";

const api = new API();

// Authenticate with existing Riot session cookies
await api.auth.cookieReauth("ssid=...; clid=...; sub=...");

console.log("Logged in as:", api.data.puuid);
console.log("Region:", api.region);

// Fetch current rank
const mmr = await api.player.getMMR(api.data.puuid!);
console.log("Rank tier:", mmr.LatestCompetitiveUpdate.TierAfterUpdate);

Authentication

Cookie Re-auth

Fastest method — exchange an existing Riot session cookie for a fresh access token. Automatically sets api.data, api.region, and api.client_version.

const api = new API();
await api.auth.cookieReauth("ssid=...; sub=...; csid=...");
// api.data.access_token, api.data.puuid, api.region are all set

QR Code Auth

Authenticate by scanning a QR code with the Riot Mobile app. No password required.

import qrcode from "qrcode";
import { API } from "@windowsedd/valorant-api";

const api = new API();

const countryCode = process.env.COUNTRY_CODE ?? "US";
await api.qrcode.login(countryCode, async (url) => {
    console.log(await qrcode.toString(url, { type: "terminal", small: true }));
    console.log("Scan with the Riot Mobile app...");
});
// api.data.puuid, api.region, api.data.access_token are all set
console.log("Logged in as:", api.data.userinfo?.acct.game_name);

Advanced — access the raw QR session for custom polling:

const { login_url, session_cookies, sdk_sid } = await api.qrcode.create();

Local Riot Client

Read tokens directly from a running Riot Client / VALORANT process via the local lockfile. Useful for desktop tools.

import { LocalRiotClientAPI } from "@windowsedd/valorant-api";

// Reads C:\Users\<you>\AppData\Local\Riot Games\Riot Client\Config\lockfile
const local = LocalRiotClientAPI.initFromLockFile();

// Get current access token + entitlements from the running client
const { data } = await local.getEntitlementsToken();
console.log("Access token:", data.accessToken);
console.log("Entitlements:", data.token);
console.log("PUUID:", data.subject);

// Then initialise the API with those tokens
const api = new API();
api.data.access_token = data.accessToken;
api.data.entitlements_token = data.token;
api.data.puuid = data.subject;
api.region = "ap"; // or detect from PAS token
await api.getClientVersion();

Manual tokens

Pass pre-fetched tokens with a single call. getClientVersion() is called automatically.

const api = new API();
await api.init({
    accessToken:       "eyJ...",
    entitlementsToken: "eyJ...",
    puuid:             "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    region:            "na",
});

API Class

import { API } from "@windowsedd/valorant-api";
const api = new API();

Properties

| Property | Type | Description | | --- | --- | --- | | api.data.access_token | string \| null | Riot access token (Bearer) | | api.data.id_token | string \| null | OpenID id_token | | api.data.entitlements_token | string \| null | Entitlements JWT | | api.data.puuid | string \| null | Authenticated player's PUUID | | api.data.userinfo | PlayerInfoResponse \| null | Full user info object | | api.region | string \| null | Affinity region: na eu ap br kr latam | | api.client_version | string | VALORANT client version string | | api.client_platform | ClientPlatform | Platform header sent with every request | | api.user_agent | string | User-Agent sent with auth requests |


api.auth

Low-level auth helpers. Most apps only need cookieReauth.

| Method | Description | | --- | --- | | getCookies() | Step 1 of manual flow — returns session Set-Cookie strings | | login(username, password, captcha, cookies, remember?) | Step 2 — submit credentials | | submitMFA(otp, cookies, rememberDevice?) | Step 2b — submit 2FA code | | cookieReauth(cookies) | High-level reauth: sets api.data, api.region, api.client_version | | getEntitlementToken(access_token) | Fetch entitlements JWT | | getPASToken(access_token?) | Fetch PAS JWT (used for XMPP affinity) | | getRegion(access_token?, id_token?) | Detect region; sets api.region | | getUserinfo(access_token?) | Fetch /userinfo | | getRiotClientConfig(access_token?, entitlementsToken?) | Fetch Riot Client config |

// Full manual login flow
const cookies = await api.auth.getCookies();
const result  = await api.auth.login("[email protected]", "password", "", cookies);
if (result.type === "multifactor") {
    const mfa = await api.auth.submitMFA("123456", cookies);
}
const [access_token] = /* extract from result redirect URI */;
const entitlements   = await api.auth.getEntitlementToken(access_token);

api.player

| Method | Description | | --- | --- | | getMMR(puuid) | Rank and MMR info | | getLoadout(puuid) | Equipped loadout (skins, sprays, card, title) | | setLoadout(puuid, body) | Update loadout | | getAccountXp(puuid) | Account level and XP history | | getSettings() | Player settings (authenticated account only) | | saveSettings(body) | Save player settings | | getSession(puuid) | Active client session | | getPenalties() | Active queue restrictions | | getNames(puuids) | Bulk name lookup by PUUID array | | findAlias(gameName, tagLine?) | Search players by Riot ID | | getContract(puuid) | Active battle pass / contract progress |

const mmr   = await api.player.getMMR(puuid);
const names = await api.player.getNames([puuid1, puuid2]);
const alias = await api.player.findAlias("Shroud", "1337");

api.matches

| Method | Description | | --- | --- | | getHistory(puuid, start?, end?, queue?) | Match history (queue: all, competitive, unrated, etc.) | | getCompetitiveHistory(puuid, start?, end?) | Competitive update log | | getLeaderboard(seasonId, start?, size?) | Competitive leaderboard for a season | | getReplayInfo(puuid, type, matchIds) | Replay metadata for a list of matches — docs | | getDetails(matchId) | Full match result: players, round-by-round stats, kill feed, economies |

const history = await api.matches.getHistory(puuid, 0, 20, "competitive");
const board   = await api.matches.getLeaderboard("seasonUUID", 0, 100);
const match   = await api.matches.getDetails("matchUUID");
// match.matchInfo, match.players, match.roundResults, match.kills, match.teams

api.store

| Method | Description | | --- | --- | | getStorefront(puuid) | Daily/weekly shop offers | | getWallet(puuid) | VP / Radianite balances | | getEntitlements(puuid) | All owned items | | getBattlepassPurchase(puuid) | Owned battle pass tier upgrades | | getFavorites(puuid) | Favorited items | | getPurchaseHistory(cookies) | Full purchase history (requires raw cookies) |

const shop    = await api.store.getStorefront(puuid);
const wallet  = await api.store.getWallet(puuid);
const skins   = await api.store.getEntitlements(puuid);

api.party

| Method | Description | | --- | --- | | get(partyId) | Full party info | | getByPlayer(puuid) | Party the player is currently in | | removePlayer(puuid) | Remove a player from the current party | | setMemberReady(partyId, puuid, ready) | Set a member's ready state | | refreshCompetitiveTier(partyId, puuid) | Refresh a member's displayed rank | | refreshPlayerIdentity(partyId, puuid) | Refresh a member's card/title/level | | refreshPings(partyId, puuid) | Refresh a member's server ping data | | changeQueue(partyId, queueId) | Change the party's queue | | startCustomGame(partyId) | Start the custom game | | enterMatchmakingQueue(partyId) | Enter the matchmaking queue | | leaveMatchmakingQueue(partyId) | Leave the matchmaking queue | | setAccessibility(partyId, accessibility) | Set party visibility ("OPEN" / "CLOSED") | | setCustomGameSettings(partyId, settings) | Update custom game configuration | | invite(partyId, name, tagline) | Invite a player by Riot ID | | request(partyId) | Request to join a party | | decline(partyId, requestId) | Decline a join request | | getChatToken(partyId) | Get MUC chat token { Token, Room } | | getVoiceToken(partyId) | Get voice room token { Token, Room } | | disableCode(partyId) | Disable the invite code | | generateCode(partyId) | Generate a new invite code | | joinByCode(code) | Join a party by invite code |

const party   = await api.party.getByPlayer(puuid);
const partyId = party.CurrentPartyID;

await api.party.changeQueue(partyId, "competitive");
await api.party.setAccessibility(partyId, "OPEN");
await api.party.invite(partyId, "PlayerName", "TAG");
await api.party.enterMatchmakingQueue(partyId);

const chatToken  = await api.party.getChatToken(partyId);
const voiceToken = await api.party.getVoiceToken(partyId);

const code = (await api.party.generateCode(partyId)).InviteCode;
await api.party.joinByCode(code);

api.pregame

Methods available while in agent-select (before the match starts).

| Method | Description | | --- | --- | | getPlayer(puuid) | Player's current pregame match ID | | getMatch(matchId) | Full pregame match state | | getLoadouts(matchId) | All players' loadouts in pregame | | selectCharacter(matchId, agentId) | Hover an agent | | lockCharacter(matchId, agentId) | Lock an agent | | quit(matchId) | Dodge the match |


api.coregame

Methods available during a live match.

| Method | Description | | --- | --- | | getPlayer(puuid) | Player's current match ID | | getMatch(matchId) | Live match state | | getLoadouts(matchId) | All players' equipped loadouts | | quit(puuid, matchId) | Forfeit / quit the match |


api.customgame

| Method | Description | | --- | --- | | getConfigs() | Available custom game settings | | start(partyId) | Start a custom game | | setSettings(partyId, settings) | Change custom game configuration |


api.esport

| Method | Description | | --- | --- | | getUpcomingMatches(leagueIDs, locale?, sport?) | Upcoming esports matches | | getMatches(matchIds, locale?, sport?) | Esports match details |


api.premier

| Method | Description | | --- | --- | | getPlayer(puuid) | Premier player info | | getPlayerCrests(puuid) | Premier crests | | getEligibility() | Whether the account can join Premier | | getSeasons(affinity?) | All Premier seasons for a region | | getActiveSeason(affinity?) | Current active Premier season | | getConferences(affinity?) | All conferences | | getRoster(rosterId) | Premier roster | | getRosterMatchHistory(rosterId) | Roster match history | | getRosterPublicInfo(rosterId) | Public roster info | | setRosterCustomization(rosterId, body) | Update roster banner/icon |


api.restrictions

| Method | Description | | --- | --- | | getPenalties() | Active matchmaking penalties for the authenticated player | | getPlayerInterventions() | Active and upcoming behavioral interventions grouped by category | | getPlayerReportToken(matchId, offenderPuuid) | Signed JWT token used to report a player from a specific match | | getPlayerAvoidList() | Players the authenticated account has chosen to avoid in matchmaking |

const penalties     = await api.restrictions.getPenalties();
const interventions = await api.restrictions.getPlayerInterventions();
const avoidList     = await api.restrictions.getPlayerAvoidList();

const reportToken   = await api.restrictions.getPlayerReportToken(matchId, offenderPuuid);
console.log(reportToken.Token); // signed JWT

api.qrcode

| Method | Description | | --- | --- | | login(countryCode, onQrCode, pollInterval?) | Full QR flow — create session, display QR, poll until scanned, then set api.data and api.region automatically | | create() | Low-level — create a QR session and return { login_url, session_cookies, sdk_sid, … } |

import qrcode from "qrcode";

const countryCode = process.env.COUNTRY_CODE ?? "US";
await api.qrcode.login(countryCode, async (url) => {
    console.log(await qrcode.toString(url, { type: "terminal", small: true }));
});
// api.data.puuid, api.region, api.data.access_token are now set

Misc methods

| Method | Description | | --- | --- | | api.init({ accessToken, entitlementsToken, puuid, region }) | Set tokens and fetch client version in one call | | api.getClientVersion() | Fetch current client version from valorant-api.com; sets api.client_version | | api.getContent() | Seasonal content (maps, agents, seasons, etc.) | | api.getConfig(region) | Client configuration for a region |

api.init() and cookieReauth() both call getClientVersion() automatically. Only call it manually when setting tokens by hand.


LocalRiotClientAPI

Interfaces with the local RiotClientServices.exe HTTP API that runs while VALORANT is open. Useful for desktop overlay tools and local automation.

import { LocalRiotClientAPI } from "@windowsedd/valorant-api";

// Three ways to construct
const local = LocalRiotClientAPI.initFromLockFile();            // reads default lockfile
const local = LocalRiotClientAPI.initFromLockFile("C:\\path");  // custom lockfile path
const local = new LocalRiotClientAPI("127.0.0.1", "port", "riot", "password");

| Method | Description | | --- | --- | | initFromLockFile(path?) | Static — read lockfile, return new instance | | parseLockFile(path?) | Static — parse lockfile, return LockFile object | | launch(path?, port?, address?, product?, patchline?) | Static — spawn RiotClientServices.exe as a child process | | getEntitlementsToken() | { accessToken, token (entitlements JWT), subject (puuid) } | | login(username, password, persistLogin?) | Log in via the local client | | logout() | Log out | | getFriends() | Friend list | | getFriendRequests() | Pending friend requests | | addFriend(gameName, gameTag) | Send a friend request | | removeFriend(puuid) | Remove a friend | | sendMessage(message, cid) | Send a chat message (v5) | | getPartyChatInfo() | Party chat conversation metadata | | getPreGameChatInfo() | Pre-game chat conversation metadata | | getCurrentGameChatInfo() | Current game chat conversation metadata | | getAllChatInfo() | All active chat conversations | | getChatParticipants(cid?) | Participants for all conversations, or a specific one by cid | | sendChat(cid, message, type?) | Send a message to a conversation (type: "groupchat" / "chat" / "system", default "groupchat") | | getChatHistory(cid?) | Message history for all conversations, or a specific one by cid |

const local = LocalRiotClientAPI.initFromLockFile();
const { data } = await local.getEntitlementsToken();
// data.accessToken — Riot access token
// data.token       — entitlements JWT
// data.subject     — PUUID

XMPP — Friends, Presence & Match Chat

The XMPP module provides VALORANT's real-time social layer: friends list, presence updates, and in-game status via the Riot XMPP protocol.

import { xmpp } from "@windowsedd/valorant-api";

const client = new xmpp.ValorantXmppClient({ autoReconnect: true });

ValorantXmppClient config

| Option | Type | Default | Description | | --- | --- | --- | --- | | autoReconnect | boolean | true | Reconnect automatically on drop | | maxReconnectAttempts | number | 5 | Max reconnects within the timeframe | | reconnectAttemptsTimeframe | number | 15000 | Window for counting reconnects (ms) | | updatePresenceInterval | number \| () => number | 120000 | How often to re-send presence (ms) | | autoAcceptIncomingRequests | boolean | false | Auto-accept incoming friend requests | | authConfig | ValorantAuthConfig | — | Auth options (region override, reauth interval) |


XMPP Auth Methods

Pass one of the following option objects to client.login(options):

Cookie auth

await client.login({ ssidCookie: "ssid=...; clid=...; sub=..." });

QR code auth

import qrcode from "qrcode";

await client.login({
    onQrCode: async (url) => {
        console.log(await qrcode.toString(url, { type: "terminal", small: true }));
    },
    countryCode: process.env.COUNTRY_CODE ?? "US",
    pollInterval: 2000,  // ms between QR polls
});

Local Riot Client (lockfile)

// Read tokens from the running Riot Client automatically
await client.login({ local: true });

// Or pass an existing LocalRiotClientAPI instance
import { LocalRiotClientAPI } from "@windowsedd/valorant-api";
const localClient = LocalRiotClientAPI.initFromLockFile();
await client.login({ local: localClient });

Pre-fetched tokens

await client.login({
    accessToken: "eyJ...",
    pasToken: "eyJ...",         // optional — fetched automatically if omitted
    entitlementsToken: "eyJ...", // optional — fetched automatically if omitted
});

No login (reconnect reuse)

await client.login(); // reuses tokenStorage from previous session

Events

client.on("ready",          ()          => { /* connected */ });
client.on("presence",       (presence)  => { /* PresenceOutput      */ });
client.on("message",        (msg)       => { /* messageOutput       */ });
client.on("matchmessage",   (msg)       => { /* matchMessageOutput  */ });
client.on("roster",         (roster)    => { /* Friend[]            */ });
client.on("iq",             (iq)        => { /* IqOutput            */ });
client.on("incomingRequest",(data)      => { /* raw XML             */ });
client.on("error",          (err)       => { /* Error               */ });

| Event | Payload | When | | --- | --- | --- | | ready | — | Login + session established | | presence | PresenceOutput | Any friend presence update | | message | messageOutput | 1-to-1 chat message | | matchmessage | matchMessageOutput | MUC groupchat message from a match room | | roster | Friend[] | Initial friends list received | | iq | raw IQ | Any IQ stanza received | | incomingRequest | raw stanza | Incoming friend request | | error | Error | Connection or protocol error |

PresenceOutput shape

| Field | Type | Description | | --- | --- | --- | | sender | JidObject \| null | Sender JID (parsed) | | recipient | JidObject \| null | Recipient JID | | status | string \| null | "chat" / "away" / "dnd" | | statusMessage | string \| null | Raw status message | | gamePresence | GamePresence[] \| null | Per-game presence objects | | last_online | Date \| null | Last seen time (when offline) | | type | string \| null | "unavailable" when going offline | | id | string \| null | Presence stanza ID | | platform | string \| null | Platform string (e.g. "windows") | | other | object \| null | Any unrecognised fields |


XMPP Methods

| Method | Returns | Description | | --- | --- | --- | | client.login(options?) | Promise<void> | Connect and authenticate | | client.end() | void | Gracefully close the connection | | client.sendPresence() | Promise<null> | Re-broadcast current presence | | client.fetchFriends() | Promise<Friend[]> | Refresh and return friends list | | client.sendFriendRequest(name, tag) | Promise<sendFriendRequestResponse> | Send a friend request by Riot ID | | client.acceptFriendRequest(puuid) | Promise<void> | Accept a pending request | | client.acceptAllFriendRequests() | Promise<void> | Accept every incoming request | | client.removeAllSentRequests() | Promise<void> | Cancel all outgoing requests | | client.removeFriendOutgoing(jid) | Promise<void> | Cancel one outgoing request | | client.sendMessage(jid, content) | Promise<void> | Send a 1-to-1 chat message | | client.joinMatchMuc(mucJid, matchToken?) | Promise<void> | Join a match MUC room | | client.leaveMatchMuc(mucJid) | Promise<void> | Leave a match MUC room | | client.sendMucMessage(mucJid, content) | Promise<void> | Send a groupchat message to a MUC room | | client.getXmppInstance() | Promise<XmppClient> | Raw XMPP socket handle |

Account info (after ready)

client.account.name       // "NoName"
client.account.tagline    // "414"
client.account.jid.jid    // "[email protected]/RC-VALORANT-NODE"
client.tokenStorage.puuid // player PUUID
client.tokenStorage.region // XmppRegionObject
client.friends            // Friend[] — latest roster snapshot

Match MUC chat

Join and interact with the XMPP group-chat rooms that Riot creates for each live match. The room JIDs and match token come from api.coregame.getMatch().

const match = await api.coregame.getMatch(matchId);

// Join team and all-players rooms
await client.joinMatchMuc(match.TeamMUCName, match.TeamMatchToken);
await client.joinMatchMuc(match.AllMUCName,  match.TeamMatchToken);

// Receive messages — fires for groupchat only, not 1-to-1 chat
client.on("matchmessage", (msg) => {
    console.log(msg.room);       // "[email protected]"
    console.log(msg.senderNick); // sender PUUID
    console.log(msg.body);       // message text
});

// Send to the team room
await client.sendMucMessage(match.TeamMUCName, "hello team");

// Leave when done
await client.leaveMatchMuc(match.TeamMUCName);
await client.leaveMatchMuc(match.AllMUCName);

matchMessageOutput

| Field | Type | Description | | --- | --- | --- | | body | string | Message text | | room | string | Bare MUC JID (e.g. [email protected]) | | senderNick | string | Sender's nick within the MUC (PUUID) | | id | string | Stanza ID | | type | "groupchat" | Always "groupchat" |

TeamVoiceID is for Vivox in-game voice — a separate SIP-based protocol not covered by this library.


Presence Builders

Use builders to customise the XMPP presence stanza your client broadcasts.

import { xmpp } from "@windowsedd/valorant-api";

const { PresenceBuilder, KeystonePresenceBuilder, ValorantPresenceBuilder } = xmpp.Builders;

const presence = new PresenceBuilder()
    .addKeystonePresence(new KeystonePresenceBuilder())
    .addValorantPresence(
        new ValorantPresenceBuilder().setPresence({
            sessionLoopState: "INGAME",
            matchMap: xmpp.Maps.Ascent.url,
            queueId: xmpp.Queues.Competitive.id,
            competitiveTier: xmpp.Ranks.IMMORTAL1,
            partyId: "your-party-uuid",
            isPartyOwner: true,
            partySize: 2,
            maxPartySize: 5,
            accountLevel: 200,
        })
    );

// Set on client (auto-broadcasts on interval)
client.presence = presence;

// Or send manually
await client.sendPresence();

PresenceBuilder API

| Method | Description | | --- | --- | | addKeystonePresence(builder) | Attach Keystone (Riot Client) presence | | addValorantPresence(builder) | Attach VALORANT game presence |

ValorantPresenceBuilder API

| Method | Description | | --- | --- | | setPresence(obj \| fn) | Set / override presence fields | | _toJSON() | Serialize to JSON string | | _toBase64() | Serialize to base64 (as sent over XMPP) |


ValorantPresenceObject fields

All fields are optional and merged with defaults.

| Field | Type | Default | | --- | --- | --- | | sessionLoopState | "MENUS" \| "PREGAME" \| "INGAME" | "MENUS" | | partyOwnerSessionLoopState | "MENUS" \| "PREGAME" \| "INGAME" | "MENUS" | | matchMap | MapUrls \| string | "" | | partyOwnerMatchMap | MapUrls \| string | "" | | queueId | QueueIds \| string | "unrated" | | partyId | string | "00000000-0000-0000-0000-000000000000" | | isPartyOwner | boolean | true | | partyState | "DEFAULT" \| "MATCHMAKING" \| … | "DEFAULT" | | partyAccessibility | "OPEN" \| "CLOSED" | "CLOSED" | | partySize | number | 1 | | maxPartySize | number | 5 | | partyLFM | boolean | false | | competitiveTier | Ranks \| number | Ranks.IRON1 (3) | | leaderboardPosition | number | 0 | | accountLevel | number | 1 | | playerCardId | string | default card UUID | | playerTitleId | string | "" | | preferredLevelBorderId | string | "" | | isIdle | boolean | false | | partyClientVersion | string | "release-04.03-shipping-6-671292" | | provisioningFlow | "Invalid" \| "Matchmaking" | "Invalid" | | tournamentId | string | "" | | rosterId | string | "" |


Maps · Queues · Ranks

import { xmpp } from "@windowsedd/valorant-api";

// Maps — static properties with name, uuid, url
xmpp.Maps.Ascent.url      // "/Game/Maps/Ascent/Ascent"
xmpp.Maps.Bind.uuid       // "2c9d57ec-4431-9c5e-2939-8f9ef6dd5cba"
// Available: Ascent, Bind, Breeze, Fracture, Haven, Icebox, Split, TheRange

// Queues — static properties with id and name
xmpp.Queues.Competitive.id  // "competitive"
xmpp.Queues.Unrated.id      // "unrated"
// Available: Competitive, Custom, Deathmatch, Escalation, NewMap,
//            Replication, SnowballFight, SpikeRush, Unrated

// Ranks — numeric enum starting at 0
xmpp.Ranks.UNRANKED   // 0
xmpp.Ranks.IRON1      // 3
xmpp.Ranks.GOLD1      // 12
xmpp.Ranks.IMMORTAL1  // 24
xmpp.Ranks.RADIANT    // 27

Types

All response types are exported from the package root and from the typed sub-modules:

import type {
    // Auth
    TokenStorage, TokenAuth, CookieAuth, QrAuth, LocalAuth, ValorantAuthConfig,

    // Presence / XMPP
    PresenceOutput, messageOutput, matchMessageOutput, Friend, JidObject, sendFriendRequestResponse,

    // Player
    PlayerMMRResponse, PlayerLoadoutResponse, AccountXPResponse,

    // Matches
    CompetitiveUpdatesResponse, LeaderboardResponse,

    // Store
    StorefrontResponse, WalletResponse,

    // Party
    PartyResponse, PartyPlayerResponse,

    // Pregame / CoreGame
    PregameMatchResponse, CoreGameMatchResponse,

    // Premier
    PremierPlayerResponse, PremierRosterResponse,

    // Esports
    EsportsMatchesResponse,

    // Misc
    PlayerInfoResponse, ContractsResponse, getSessionResponse,
} from "@windowsedd/valorant-api";

VLR.gg — Esports Data

VLR scrapes the public vlr.gg site. No Riot auth required. Because it parses HTML, shapes can break if vlr.gg changes its markup.

import { VLR } from "@windowsedd/valorant-api";

const vlr = new VLR();

Methods

| Method | Description | | --- | --- | | getPlayers() | Global player stat leaderboard from /stats | | getRankings(region) | Team rankings for a region from /rankings/:region | | getEvents() | All events listed on /events | | getEvent(url) | Details for a single event (teams, dates, prize pool) | | getUpcomingMatches() | Upcoming matches from /matches | | getMatchResults() | Completed matches from /matches/results | | getMatch(url) | Full match details with per-map player stats and round history |

Regions (VlrRegion)

import { VLR, VlrRegion } from "@windowsedd/valorant-api";

const { teams } = await vlr.getRankings(VlrRegion.AsiaPacific);

| Enum | Value | | --- | --- | | VlrRegion.NorthAmerica | "na" | | VlrRegion.Europe | "eu" | | VlrRegion.AsiaPacific | "ap" | | VlrRegion.SouthAsia | "sa" | | VlrRegion.Japan | "jp" | | VlrRegion.Oceania | "oce" | | VlrRegion.MENA | "mn" | | VlrRegion.GameChangers | "gc" | | VlrRegion.Brazil | "br" | | VlrRegion.Korea | "kr" | | VlrRegion.China | "cn" | | VlrRegion.LatinAmerica | "la" | | VlrRegion.LatinAmericaSouth | "la-s" | | VlrRegion.LatinAmericaNorth | "la-n" |

Examples

// Team rankings
const { teams } = await vlr.getRankings("ap");
console.log(teams[0].team_name, teams[0].rating);

// Upcoming matches
const { matches } = await vlr.getUpcomingMatches();
for (const m of matches) {
    console.log(`${m.team_one_name} vs ${m.team_two_name} — ${m.match_time} (${m.status})`);
}

// Full match details (per-map stats, round history)
const match = await vlr.getMatch("https://www.vlr.gg/12345/team-a-vs-team-b-...");
for (const map of match.maps) {
    console.log(`${map.map_name}: ${map.team_one_score}-${map.team_two_score}`);
    for (const p of map.players) {
        console.log(`  ${p.player_name} (${p.agent}) — ACS: ${p.acs}, Rating: ${p.rating}`);
    }
}

// Events
const { events } = await vlr.getEvents();
const detail = await vlr.getEvent(events[0].event_url);
console.log(detail.event_name, detail.prize_pool, detail.teams.map(t => t.team_name));

VLR Types

| Type | Description | | --- | --- | | VlrPlayerStat | Row from the player stats leaderboard | | VlrRankedTeam | Row from a regional rankings page | | VlrEvent | Event card (name, status, dates, prize pool, region) | | VlrEventDetail | Full event page (adds team list) | | VlrMatchPreview | Match card from upcoming/results list | | VlrMatchDetail | Full match (scores, maps, players, rounds) | | VlrMatchMap | Per-map breakdown with player rows and round history | | VlrMatchPlayer | Player stat row: ACS, K/D, ADR, KAST, HS%, FK/FD | | VlrRound | Single round: number, winner, side, win type |


Utilities

import { utils } from "@windowsedd/valorant-api";

// Parse Set-Cookie headers into a key→value object
const cookies = utils.parseSetCookie(setCookieHeaderArray);
console.log(cookies["ssid"]);

// Extract access_token and id_token from a Riot redirect URI
const [access_token, id_token] = utils.extractTokensFromUri(redirectUri);

// Stringify a cookie object into a single Cookie header value
const header = utils.stringifyCookies({ ssid: "...", sub: "..." });

ItemType

UUIDs for in-game item categories, used with store and entitlement endpoints.

import { ItemType } from "@windowsedd/valorant-api";

console.log(ItemType.Skins);   // "e7c63390-eda7-46e0-bb7a-a6abdacd2433"

| Key | UUID | | --- | --- | | Agents | 01bb38e1-da47-4e6a-9b3d-945fe4655707 | | Skins | e7c63390-eda7-46e0-bb7a-a6abdacd2433 | | SkinVariants | 3ad1b2b2-acdb-4524-852f-954a76ddae0a | | Sprays | d5f120f8-ff8c-4aac-92ea-f2b5acbe9475 | | GunBuddies | dd3bf334-87f3-40bd-b043-682a57a8dc3a | | Cards | 3f296c07-64c3-494c-923b-fe692a4fa1bd | | Titles | de7caa6b-adf7-4588-bbd1-143831e786c6 | | Contracts | f85cb6f7-33e5-4dc8-b609-ec7212301948 | | Flex | 03a572de-4234-31ed-d344-ababa488f981 |


ValError

Thrown by all API methods on non-200 responses. Includes the raw response for debugging.

import { ValError } from "@windowsedd/valorant-api";

try {
    await api.player.getMMR(puuid);
} catch (err) {
    if (err instanceof ValError) {
        console.error(err.name);    // e.g. "ENTITLEMENTS_ERROR"
        console.error(err.message); // human-readable description
        console.error(err.data);    // raw response object
    }
}

Regions

| Value | Region | | --- | --- | | na | North America | | eu | Europe | | ap | Asia Pacific | | br | Brazil | | kr | Korea | | latam | Latin America |


Disclaimer

This library uses Riot Games' internal (private) API endpoints. It is not affiliated with or endorsed by Riot Games. Use at your own risk — your account may be subject to restrictions if Riot's terms of service are violated.


License

MIT