zhonya
Version:
A simple and typed League of Legends API wrapper for Node.js
85 lines (55 loc) โข 1.69 kB
Markdown
# โ Zhonya

.

A simple and direct wrapper for the Riot Games API (League of Legends), built with TypeScript.
## ๐ Installation
```bash
npm install zhonya
```
## ๐ Initialization
```ts
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](https://developer.riotgames.com/) is required for most endpoints, but some data can be accessed without authentication.
## ๐ Usage Examples
```ts
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:
- [Methods requiring API Key](api-key-required.md)
- [Methods not requiring API Key](api-key-not-required.md)
## ๐ฆ Requirements
- Node.js >= 18
- A valid Riot API key: [developer.riotgames.com](https://developer.riotgames.com) (for authenticated methods)
## ๐ License
MIT