Package Exports
- @javilobo8/riot-api
- @javilobo8/riot-api/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@javilobo8/riot-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@javilobo8/riot-api
Another Riot API wrapper for Node.js.
Features
- Fully typed
- Promise-based
- Constants
- Axios based requests
TODO
- Add replacement for DDragon CDN host
- Add Redis cache
- Parse response and error Rate Limit headers
- Add new spectator byPuuid v5 endpoint
Installation
npm install @javilobo8/riot-api
Usage
import { RiotAPILOL, DDragonAPI } from '@javilobo8/riot-api';
// RiotAPILOL
const riotApi = new RiotAPILOL({
apiKey: 'RGAPI-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
});
const accountResponse = await riotApi.account.byRiotId('EUW', 'javilobo8', 'zoso');
/*
{
data: {
puuid: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
gameName: 'javilobo8',
tagLine: 'zoso',
},
status: 200,
statusText: 'OK',
headers: {
'x-app-rate-limit': 'XX:XX,XX:XX',
'x-method-rate-limit': 'XX:XX,XX:XX',
'x-app-rate-limit-count': 'XX:XX,XX:XX',
'x-method-rate-limit-count': 'XX:XX,XX:XX',
...
},
}
*/
// DDragonAPI
const ddragonApi = new DDragonAPI();
const versionResponse = await ddragonApi.ddragon.getCurrentVersion();
/*
{
data: '11.16.1', // Current patch version
status: 200,
statusText: 'OK',
headers: {
...
},
}
*/
Debugging
This package uses the debug
package to log debug messages. To enable debug messages, set the DEBUG
environment variable to riot-api:*
.
DEBUG=riot-api:* node your-app.js
Base package: @javilobo8/riot-api