// @ts-check import { RiotAPI, RiotAPITypes, PlatformId } from "@fightmegg/riot-api"; /** @type {RiotAPITypes.Config} */ const config = { cache: { cacheType: "ioredis", // local or ioredis client: "redis://redis:6379", // leave null if client is local ttls: { byMethod: { [RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_SUMMONER_NAME]: 30 * 60 * 100, // ms }, }, }, }; const rAPI = new RiotAPI("RGAPI-8f41294d-7bb1-4fd5-83d4-773a8a7b25f5", config); const summoner = await rAPI.summoner.getBySummonerName({ region: PlatformId.NA1, summonerName: "RavenShade", }); console.log(`${JSON.stringify(summoner, null, " ")}`);