A simple library to communicate with Riot’s League of Legend API.
To use this library you will need an API key to access the Riot API.
To get this key you need to make a request to Riot.
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 18.0 or higher is required.
If this is a brand new project, make sure to create a package.json first with the npm init
command.
Require PAT (Personal access token) for install the package
npm login --scope=@mbelangerb --auth-type=legacy --registry=https://npm.pkg.github.com
Installation is done using the npm install command:
npm install @mbelangerb/riotmodule
To run this project, you will need to add the following environment variables to your .env file
In production, to be able to communicate with the Riot API, you must add the following keys.
Riot_LolToken
and Riot_TftToken
If you are in development mode NODE_ENV="development"
you can use a unique key valid for 24 hours that is provided to you by Riot and allows access to all features (League of Legend & TFT) with the key : Riot_APIDevKey
If you want enabled the cache system you need to add key CacheEnabled=true
# Production Mode
Riot_LolToken='RGAPI-'
Riot_TftToken='RGAPI-'
# Developper Mode (24 hours tokens)
Riot_APIDevKey='RGAPI-'
import { RiotService, ValidationService, RiotHttpStatusCode } from '@mbelangerb/riotmodule';
# Initialize 'RiotService'
const service: RiotService = new RiotService();
# Validate Region
let valideRegion: string = ValidationService.convertToRealRegion(region);
# Get SummonerDTO
import { ISummonerDTO } from '@mbelangerb/riotmodule';
const apiSummoner: ISummonerDTO = await service.SummonerV4.getBySummonerName(summonerName, region);
For more information about Riot’s Developer API, please consult the official API access. : link
| Route | Status |
|–|–|
| Account | |
| Champion |
|
| Champion-Mastery |
|
| League |
|
| Summoner |
|
| TFTLeague* |
|
| TFTSummoner* |
|
*The TFT entity used for summoner and league information is the same as that used for League of Legend.