{
"$type": "site.standard.document",
"canonicalUrl": "https://devlog.croft.click/2026/06/13/atpkt-full-api",
"description": "Expanded the AT Protocol Kotlin library with a comprehensive XRPC client, Jetstream firehose support, OAuth session management, and a modular test suite.",
"path": "/2026/06/13/atpkt-full-api",
"publishedAt": "2026-06-13T12:00:00.000Z",
"site": "at://did:plc:ofrbh253gwicbkc5nktqepol/site.standard.publication/3mlen2qhzrt2s",
"tags": [
"atproto",
"kotlin",
"library",
"atpkt"
],
"textContent": "atpkt expansion\n\nThe atpkt library — a Kotlin AT Protocol client for the JVM — grew from an OAuth-focused library with basic API coverage into a comprehensive AT Protocol toolkit. The June 13 merge train nearly doubled the library's scope.\n\nfull xrpc client\n\nThe new XRPC client provides complete coverage of the AT Protocol's XRPC API surface. It handles request serialisation, response deserialisation, error mapping, and pagination for all lexicon methods. The client is structured around an atproto.blue-inspired Agent pattern that centralises authentication, rate limiting, and retry logic.\n\njetstream consumer\n\nA Jetstream client connects to the AT Protocol firehose, streaming real-time repository events. The client handles reconnection with exponential backoff, cursor management for resuming from the last processed event, and configurable filters for specific collections or DIDs.\n\noauth session manager\n\nThe OAuth session manager provides automatic token refresh, DPoP proof generation, and secure storage of session state. It implements the full AT Protocol OAuth flow — PAR, authorisation code exchange, token refresh — and surfaces session lifecycle events so calling code can react to expiration or revocation.\n\nmodular dependency audit\n\nAs part of the expansion, the library's dependencies were audited and refactored into modular components. The lexicon subsystem (type generation from AT Protocol lexicon schemas) was decoupled from the network layer, making it possible to use the type system without pulling in the HTTP client. A LexiconGenerator produces Kotlin data classes from lexicon JSON, supporting custom lexicon extensions beyond the standard AT Protocol lexicons.\n\ntest suite\n\nThe test suite now covers XRPC request/response cycles, session management state transitions, and Jetstream event parsing. Tests are organised by subsystem with shared fixtures for DID documents, OAuth tokens, and sample repository events.",
"title": "atpkt — full XRPC client, Jetstream, and OAuth session management"
}