@wardbox/whisper 0.2.0 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +18 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,27 +2,31 @@
2
2
 
3
3
  Zero-dependency TypeScript library wrapping every Riot Games API endpoint. Proactive rate limiting. Tree-shakeable per-game imports. Runs on Node 18+, Deno, Bun, and edge runtimes.
4
4
 
5
+ **[Documentation](https://wardbox.github.io/whisper)** | **[Quickstart](https://wardbox.github.io/whisper/docs/quickstart)** | **[API Reference](https://wardbox.github.io/whisper/docs/api/lol)**
6
+
5
7
  ## Install
6
8
 
7
9
  ```bash
8
- pnpm add @wardbox/whisper
9
- # or: npm install @wardbox/whisper
10
- # or: yarn add @wardbox/whisper
10
+ npm install @wardbox/whisper
11
11
  ```
12
12
 
13
13
  ## Quickstart
14
14
 
15
15
  ```typescript
16
16
  import { createClient } from '@wardbox/whisper/core';
17
+ import { accountV1 } from '@wardbox/whisper/riot';
17
18
  import { summonerV4, matchV5 } from '@wardbox/whisper/lol';
18
19
 
19
20
  const client = createClient({ apiKey: process.env.RIOT_API_KEY! });
20
21
 
22
+ // Start with a Riot ID (e.g. wardbox#666)
23
+ const account = await accountV1.getByRiotId(client, 'americas', 'wardbox', '666');
24
+
21
25
  // Platform-routed: summoner lookup
22
- const summoner = await summonerV4.getByPuuid(client, 'na1', 'PUUID_HERE');
26
+ const summoner = await summonerV4.getByPuuid(client, 'na1', account.puuid);
23
27
 
24
28
  // Regional-routed: match history
25
- const matchIds = await matchV5.getMatchIdsByPuuid(client, 'americas', summoner.puuid);
29
+ const matchIds = await matchV5.getMatchIdsByPuuid(client, 'americas', account.puuid);
26
30
  ```
27
31
 
28
32
  The client handles rate limits automatically — no 429s under normal usage.
@@ -30,12 +34,19 @@ The client handles rate limits automatically — no 429s under normal usage.
30
34
  ## Features
31
35
 
32
36
  - **Zero runtime dependencies.** Native `fetch` only. ~150 KB installed, less with tree-shaking.
33
- - **Proactive rate limiting.** Parses Riot's `X-App-Rate-Limit` and `X-Method-Rate-Limit` headers and queues before limits are hit.
37
+ - **Proactive rate limiting.** Parses Riot's rate limit headers and queues requests before limits are hit.
34
38
  - **Tree-shakeable per-game imports.** `@wardbox/whisper/lol`, `/tft`, `/val`, `/lor`, `/riftbound`, `/riot` — import only what you use.
39
+ - **Full TypeScript types.** Auto-generated from Riot's API responses. Every field has JSDoc.
35
40
 
36
41
  ## Documentation
37
42
 
38
- Full docs, guides, and the complete API reference: **https://github.com/wardbox/whisper#readme** (deployed Fumadocs site URL coming soon)
43
+ Guides, API reference, and auto-generated type tables: **[wardbox.github.io/whisper](https://wardbox.github.io/whisper)**
44
+
45
+ - [Quickstart](https://wardbox.github.io/whisper/docs/quickstart) — Riot ID to match history in 5 minutes
46
+ - [Routing](https://wardbox.github.io/whisper/docs/routing) — Platform vs regional vs Valorant routing
47
+ - [Rate Limiting](https://wardbox.github.io/whisper/docs/rate-limiting) — How proactive rate limiting works
48
+ - [Caching](https://wardbox.github.io/whisper/docs/caching) — TTL configuration and custom adapters
49
+ - [Middleware](https://wardbox.github.io/whisper/docs/middleware) — Logging, metrics, and request transformation
39
50
 
40
51
  ## License
41
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wardbox/whisper",
3
- "version": "0.2.0",
3
+ "version": "0.2.7",
4
4
  "description": "Zero-dependency TypeScript library wrapping every Riot Games API endpoint with proactive rate limiting and tree-shakeable per-game imports.",
5
5
  "keywords": [
6
6
  "riot-games",