@wynnjs/api
Typed TypeScript client for the Wynncraft API v3. Covers the public endpoints with request options, response types, Zod schemas, and rate-limit metadata.
These pages document the client. Field-level API behaviour lives on docs.wynncraft.com.
Versions
The npm package version (currently 3.0.0) is independent from the Wynncraft API release this client targets — see WYNNCRAFT_API_VERSION (3.7.2).
Install
npm install @wynnjs/api zodyarn add @wynnjs/api zodpnpm add @wynnjs/api zodbun add @wynnjs/api zoddeno add npm:@wynnjs/api npm:zodzod is a peer dependency. The client uses it for error parsing and exports schemas so you can validate responses when you want. npm 7+, pnpm, and Bun install peers automatically.
Requires TypeScript 5+ (or any runtime that can consume .d.ts files). Ships ESM and CommonJS.
Quick start
import { WynnClient } from "@wynnjs/api";
const client = new WynnClient();
const { data, rateLimit } = await client.classes.list();
console.log(Object.values(data).map((entry) => entry.name));
console.log(rateLimit?.remaining);Every module method returns a WynnResponse:
{
data: T;
rateLimit: RateLimitInfo | null;
}What next
| Topic | Why |
|---|---|
| Client | Options, modules, low-level request() |
| Authentication | Tokens, OAuth, sessions |
| Responses | Rate limits, pagination, presence flags |
| Errors | Typed WynnApiError subclasses |
| Schemas | Optional Zod validation |
| Examples | Copy-paste samples |
| API reference | Method-by-method coverage |
Cookbooks
| Recipe | Page |
|---|---|
| Walk every page of search results | Pagination |
Resolve MultipleObjectsReturned | Ambiguous matches |
OAuth code → token → me() | OAuth |
| Session cookie auth | Session auth |
| Stay under RPM | Rate limits |
Recipe full_result vs item fullResult | Recipe fullResult |
| Resolve CDN media paths | CDN assets |
Releases
See the Changelog for client versions. Runtime API alignment is WYNNCRAFT_API_VERSION — Constants.