Skip to content

Riopi is a Node.js module for interacting with Riot Game API (not the games)

License

Notifications You must be signed in to change notification settings

Nathan94600/Riopi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Riopi

  • Riopi 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.
  • Riopi was created under Riot Games' "Legal Jibber Jabber" policy using assets owned by Riot Games. Riot Games does not endorse or sponsor this project.

About

Riopi is a Node.js module for interacting with Riot Game API (not the games). The module handles rate limits and includes a caching system.

Example usage

Install riopi :

npm install riopi

Get account by access token :

import Riopi from "riopi";

const riopi = new Riopi("Your RIOT_TOKEN", "EUROPE");

riopi.getAccountByAccessToken("ACCESS_TOKEN").then(account => {
  if (typeof account == "string") console.log(`Account: ${account}`);
  else {
    console.log(`Puuid: ${account.puuid}`);
    console.log(`Pseudo: ${account.gameName && account.tagLine ? `${account.gameName}#${account.tagLine}` : "Anonymous"}`);
  }
});

Get account by puuid :

import Riopi from "riopi";

const riopi = new Riopi("Your RIOT_TOKEN", "EUROPE");

riopi.getAccountByPuuid("PUUID").then(account => {
  if (typeof account == "string") console.log(`Account: ${account}`);
  else {
    console.log(`Puuid: ${account.puuid}`);
    console.log(`Pseudo: ${account.gameName && account.tagLine ? `${account.gameName}#${account.tagLine}` : "Anonymous"}`);
  }
});

Get account by riot id :

import Riopi from "riopi";

const riopi = new Riopi("Your RIOT_TOKEN", "EUROPE");

riopi.getAccountByRiotId("GAME_NAME", "TAG_LINE").then(account => {
  if (typeof account == "string") console.log(`Account: ${account}`);
  else {
    console.log(`Puuid: ${account.puuid}`);
    console.log(`Pseudo: ${account.gameName && account.tagLine ? `${account.gameName}#${account.tagLine}` : "Anonymous"}`);
  }
});

Get active shard for a player :

import Riopi from "riopi";

const riopi = new Riopi("Your RIOT_TOKEN", "EUROPE");

riopi.getPlayerActiveShard(Games.Valorant, "PUUID").then(player => {
  if (typeof player == "string") console.log(`Response: ${player}`);
  else console.log(`Active shard: ${player.activeShard}`);
});

About

Riopi is a Node.js module for interacting with Riot Game API (not the games)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published