Skip to content

pedrorreiro/zhonya

Repository files navigation

⌛ Zhonya

npm (scoped) . NPM Downloads

A simple and direct wrapper for the Riot Games API (League of Legends), built with TypeScript.


🚀 Installation

npm install zhonya

💠 Initialization

import { ZhonyaClient } from "zhonya";

// With API Key (Full Access)
const clientKey = ZhonyaClient.init({
  riotApiKey: "YOUR_RIOT_API_KEY",
  // Optional configuration
  regionalRouting: "europe", // Default: "americas"
  platformRouting: "euw1", // Default: "br1"
});

// Without API Key (Limited Access)
const clientNoKey = ZhonyaClient.init();

Note: A Riot API key is required for most endpoints, but some data can be accessed without authentication.


📘 Usage Examples

import { ZhonyaClient } from "zhonya";

// Client with API key - full access
const client = ZhonyaClient.init({
  riotApiKey: "YOUR_RIOT_API_KEY",
});

// Client without API key - limited access
const clientNoKey = ZhonyaClient.init();

// No API key required
await clientNoKey.champions.getAll();

// API key required - throws error if no API key is provided
await client.summoner.getByName("summoner-name");

🧹 Available APIs

  • Champions API
  • Free Week API
  • Summoner API

For details on which methods require API keys, see:


📦 Requirements


📄 License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors