Getting started

About

Shieldbow is a powerful Node.js module that enables you to easily interact with the RIOT API.

Some features of shieldbow are

  • Object-oriented
  • Predictable
  • Highly performant
Migration

If you are migrating from v1 to v2, please read the migration guide.

Installation

Install using your favorite package manager.

NPM
  npm install --save shieldbow
Yarn
  yarn add shieldbow
PNPM
  pnpm add shieldbow

Example usage

import { Client } from 'shieldbow';const client = new Client('MY_API_KEY');client  .initialize({    region: 'na', // defaults to 'na' anyways.  })  .then(async () => {    // After initialization, you can use the client to make requests    // For example, lets fetch the following details of a summoner    // - Summoner name, summoner level    // - SoloQ ranking and LP    // - The highest champion mastery    const summoner = await client.summoners.fetchBySummonerName('TheDrone7');    const leagueEntry = await summoner.fetchLeagueEntries();    const championMastery = summoner.championMastery;    const soloQ = leagueEntry.get('RANKED_SOLO_5x5');    const highest = await championMastery.highest();    console.log(`Summoner name: ${summoner.name} (level: ${summoner.level}).`);    console.log(`SoloQ: ${soloQ.tier} ${soloQ.division} (${soloQ.lp} LP).`);    console.log(`Highest champion mastery: ${highest.champion.name} (M${highest.level} ${highest.points} points).`);  });

Before you run this code, make sure you have replaced MY_API_KEY with your API key. You can obtain it from Riot Developer Portal. Whenever you are developing something or just fiddling around with this library, you are free to use the Development API key.

Once you have a complete project, or at least a working prototype you need to apply for production API key.

The above code assumes that you play SoloQ and have a rank assigned to you.

If you do not play SoloQ, or do not have a rank assigned to you, you will get an error.

If you are still in placements, and have a provisional rank, it would still not return a proper rank.

You can wrap your code in a try-catch block to handle the error.
try {  // code inside the async function, after initialization.} catch (error) {  console.error('The summoner is unranked in ranked solo/duo.');}

Anyway, upon running the above code, you will see something similar to the following data:

Summoner name: TheDrone7 (level: 389).
SoloQ: SILVER IV (28 LP).
Highest champion mastery: Kayn (M7 311038 points).

This can obviously change a lot.

See if it correctly fetches your own data!

Replace na (line 7) with the region you play in and TheDrone7 (line 16) with your own summoner name, then run the code again.

Resources

Here are some useful resources:

Contributing

Before creating an issue, please ensure that it hasn't already been reported or suggested, and double-check the documentation.

See the contribution guide if you'd like to submit a PR.

Help

If there is anything you do not understand, feel free to reach out to me (@TheDrone7#1624) on the Riot Games Third Party Developers Discord.