Skip to content

Client

WynnClient is the entry point. Methods are grouped by domain — player, guild, item, and so on. Prefer those over the low-level request() helper.

ts
import { WynnClient } from "@wynnjs/api";

const client = new WynnClient({
  // baseUrl?: string
  // auth?: WynnAuth
  // http?: AxiosInstance
});

Options

OptionTypeDescription
baseUrlstringOverride API_BASE_URL (https://api.wynncraft.com/v3)
authWynnAuthCredentials for authenticated endpoints
httpAxiosInstanceCustom Axios instance (useful for tests and mocks)

Modules

ModulePropertyDocs
Playerclient.playerAPI
Guildclient.guildAPI
Itemclient.itemAPI
Abilityclient.abilityAPI
Classesclient.classesAPI
Mapclient.mapAPI
Leaderboardsclient.leaderboardsAPI
Newsclient.newsAPI
Searchclient.searchAPI
OAuthclient.oauthAPI

Calling conventions

  • Path parameters come first, options second: client.player.getPlayer(username, options?)
  • Presence-only Wynncraft flags (fullResult, static, …) are booleans in options — see Responses
  • Path segments are URL-encoded for you
  • Every method returns Promise<WynnResponse<T>>

Low-level request()

For routes the modules do not cover yet:

ts
const { data, rateLimit } = await client.request<{ ok: boolean }>({
  path: "/some/route",
  method: "GET",
  params: { page: 0 },
  presenceParams: ["fullResult"],
});
FieldDescription
pathPath under the API base (leading / optional)
methodHTTP method (default GET)
paramsNormal query params
presenceParamsQuery flags sent without values
dataRequest body
headersExtra headers

Helpers

ts
client.getAuth(); // WynnAuth | undefined

Unofficial TypeScript tooling for the Wynncraft API