Skip to content

@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

sh
npm install @wynnjs/api zod
sh
yarn add @wynnjs/api zod
sh
pnpm add @wynnjs/api zod
sh
bun add @wynnjs/api zod
sh
deno add npm:@wynnjs/api npm:zod

zod 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

ts
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:

ts
{
  data: T;
  rateLimit: RateLimitInfo | null;
}

What next

TopicWhy
ClientOptions, modules, low-level request()
AuthenticationTokens, OAuth, sessions
ResponsesRate limits, pagination, presence flags
ErrorsTyped WynnApiError subclasses
SchemasOptional Zod validation
ExamplesCopy-paste samples
API referenceMethod-by-method coverage

Cookbooks

RecipePage
Walk every page of search resultsPagination
Resolve MultipleObjectsReturnedAmbiguous matches
OAuth code → token → me()OAuth
Session cookie authSession auth
Stay under RPMRate limits
Recipe full_result vs item fullResultRecipe fullResult
Resolve CDN media pathsCDN assets

Releases

See the Changelog for client versions. Runtime API alignment is WYNNCRAFT_API_VERSIONConstants.

Unofficial TypeScript tooling for the Wynncraft API