Skip to content
devjiwonchoiPublic

About

Minimal Lichess API Client for Node.js

Topics

Resources

Stars

33 stars

Watchers

2 watching

Forks

Repository files navigation

equine 🐴

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.

Install

pnpm add equine

Usage

Set 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.

Providing the token manually

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.

API reference

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.

How it stays current

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.

About

Minimal Lichess API Client for Node.js

Topics

Resources

Stars

33 stars

Watchers

2 watching

Forks

Releases

Used by

Contributors

Languages