RiotAPI
Node.JS minimal Riot API client written in Typescript
Features
Rate limiting through @fightmegg/riot-rate-limiter
Automatic retries
TypeScript typings
100% endpoint coverage (incl. DDragon)
Caching with custom ttls per endpoint
Request prioritization
Installation
$ npm install @fightmegg/riot-api
Usage
import { RiotAPI , RiotAPITypes , PlatformId } from '@fightmegg/riot-api' ( async ( ) => { const rAPI = new RiotAPI ( 'RGAPI-KEY' ) ; const summoner = await rAPI . summoner . getBySummonerName ( { region : PlatformId . EUW1 , summonerName : "Demos Kratos" , } ) ; } ) ( )
Config
const config : RiotAPITypes . Config = { debug : false , cache : { cacheType : 'local' , // local or ioredis client : 'redis://localhost:6739' , // leave null if client is local ttls : { byMethod : { [ RiotAPITypes . METHOD_KEY . SUMMONER . GET_BY_SUMMONER_NAME ] : 5000 , // ms } } } } const rAPI = new RiotAPI ( 'RGA...
Comentarios
Publicar un comentario