Introduction
Whisper - A typed, zero-dependency TypeScript wrapper for every Riot Games API endpoint
Whisper is a TypeScript library that wraps every Riot Games API endpoint with full type safety, proactive rate limiting, and tree-shakeable per-game imports. Zero runtime dependencies -- just native fetch.
Features
- Zero runtime dependencies -- uses native
fetchonly. Works in Node, Deno, Bun, and edge runtimes. - Proactive rate limiting -- parses Riot's rate limit headers and queues requests before hitting limits. No more 429s.
- Tree-shakeable -- import only the game you need:
@wardbox/whisper/lol,@wardbox/whisper/tft, etc. - Type-safe routing -- platform vs regional vs Valorant routing enforced at compile time. Wrong route type = type error.
- Configurable caching -- per-method TTL with pluggable adapters (in-memory default, Redis, custom).
- Middleware pipeline -- intercept requests and responses for logging, metrics, and custom behavior.
Getting Started
New to Whisper? Start here:
- Quickstart -- Install the package and make your first API call in under 5 minutes
Guides
Deep dives into core concepts:
- Routing -- Understand platform, regional, and Valorant routing types
- Rate Limiting -- How the proactive rate limiter works and how to configure it
- Caching -- TTL configuration, custom adapters, and cache behavior
- Middleware -- Build logging, metrics, and custom interceptors
API Reference
Type tables and method signatures for every game:
- League of Legends -- 13 API groups (summoner, match, league, spectator, and more)
- Teamfight Tactics -- 5 API groups
- Valorant -- 6 API groups
- Legends of Runeterra -- 2 active API groups (maintenance mode)
- Riftbound -- 1 API group
- Riot (Shared) -- Account v1 (used across all games)