Minimal Lichess API client for Node.js — a fully-typed SDK generated from the Lichess OpenAPI specification.
Note
Authenticated endpoints require a Lichess API token. Generate one here.
pnpm add equineSet LICHESS_API_TOKEN in your environment and call any endpoint — the token
is detected automatically:
import { accountMe } from 'equine'
const res = await accountMe()
console.log(res.data?.username)Public endpoints (user profiles, TV, tournaments, tablebase, …) work with no token at all.
import { setToken, accountMe } from 'equine'
setToken(process.env.LICHESS_API_TOKEN)
const res = await accountMe()setToken() can be called at runtime to switch accounts, or with no argument
to clear the token.
Every Lichess endpoint is exposed as a named function. The name is the
operation's operationId from the spec (e.g. accountMe, apiUsersStatus,
challengeCreate), and each function carries the endpoint's summary and
description as JSDoc.
For a full, searchable index of every generated function and its types, see
src/client/sdk.gen.ts.
Equine's client is generated from Lichess's upstream OpenAPI spec by
@hey-api/openapi-ts. A scheduled GitHub Action
regenerates it and opens a PR whenever the spec changes — nothing is vendored
or hand-maintained.