First release of litchee — an async, builder-pattern Rust client for the Lichess API, published to crates.io.
Highlights
- Full API coverage — all 184 documented Lichess operations across 24 tags (users, social, tournaments, training, broadcasting, database, gameplay, engine), each reached through a typed accessor on the client.
- Async & streaming-native — built on
tokio+reqwest(rustls); NDJSON endpoints (event streams, board/bot game state, game exports, TV feeds) return aStreamyou consume directly. - "Log in with Lichess" — first-class OAuth2 Authorization Code flow with PKCE, plus personal access tokens. Tokens are held in a
Secretwrapper that redacts them fromDebug. - Typed end to end — every DTO is prefixed
Lichess*; every failure maps to a specific, matchableLichessErrorvariant. - Resilient by configuration — tunable connect/read timeouts, a bounded NDJSON line buffer (DoS guard), and an opt-in
RetryPolicyfor rate-limited (429) requests that honoursRetry-After.
Getting started
```toml
[dependencies]
litchee = "0.1"
tokio = { version = "1", features = ["full"] }
futures-util = "0.3"
```
See the examples/ directory — including oauth_flow, an end-to-end "Log in with Lichess" demo — and the PKCE guide.
MSRV: Rust 1.95 (edition 2024).