Mirror of github.com/ewanc26/atpkt
  • Kotlin 99.7%
  • Nix 0.3%
Find a file
2026-07-16 18:22:45 +01:00
.letta refactor: simplify generated type stubs and expand OAuth session tests 2026-06-26 15:59:39 +01:00
gradle/wrapper Remove build artifacts, test reports, and unused files 2026-05-26 22:54:14 +00:00
src docs: clarify AT Protocol trademark use 2026-07-16 14:10:21 +01:00
.gitattributes fix: i forgot to gradle init 2026-05-26 23:03:56 +01:00
.gitignore chore(atpkt): fix build configuration for JVM 21 compatibility and include new generated files 2026-05-29 22:53:08 +01:00
AGENTS.md docs: correct agent guidance after source audit 2026-07-16 18:22:45 +01:00
build.gradle.kts feat(namespace): implement ChatBskyNS and ToolsOzoneNS using generated types 2026-06-26 21:38:55 +01:00
CONTRIBUTING.md docs: update README and add CONTRIBUTING guidelines 2026-05-26 21:31:32 +01:00
FEATURES.md docs: Update README and add FEATURES.md for v1.0.0 parity 2026-06-13 22:46:14 +01:00
flake.lock chore(nix): add reproducible dev environment with flake.nix 2026-05-26 21:32:35 +01:00
flake.nix docs: add explanatory comments throughout codebase 2026-06-25 15:56:36 +01:00
gradle.properties fix: close dangling doc comments and add ktor-client-logging dep 2026-06-26 15:40:47 +01:00
gradlew Remove build artifacts, test reports, and unused files 2026-05-26 22:54:14 +00:00
gradlew.bat Remove build artifacts, test reports, and unused files 2026-05-26 22:54:14 +00:00
README.md docs: clarify AT Protocol trademark use 2026-07-16 14:10:21 +01:00
settings.gradle.kts docs: add explanatory comments throughout codebase 2026-06-25 15:56:36 +01:00
TRADEMARKS.md docs: clarify AT Protocol trademark use 2026-07-16 14:10:21 +01:00

atpkt

Deprecated. This project is no longer maintained. Use atproto-kotlin instead.

A professional-grade, modular AT Protocol SDK for Kotlin.

Independent project; see the trademark notice.

Overview

atpkt provides the foundational building blocks for interacting with the Authenticated Transfer Protocol (AT Protocol). Designed with a library-first architecture, it decouples core networking, authentication, and repository management logic from specific service implementations.

Key Features

  • High-Level Agent: Developer-friendly AtpAgent with namespaced access (e.g., agent.app.bsky.feed.*).
  • OAuth2 & DPoP: Robust session management with OAuthSessionManager and persistent SessionStore.
  • Jetstream Streaming: High-efficiency, JSON-based real-time event streaming via JetstreamClient.
  • Automated API Surface: 100% Lexicon coverage generated via KotlinPoet AST.
  • Robust XRPC: Low-level XrpcClient with type-safe queries, procedures, and protocol error handling.
  • Identity Resolution: Full support for DID/PLC and handle resolution.

Architecture

atpkt follows a modular design inspired by atproto-js and atproto.blue:

  • Core Library: Networking, XRPC client, and Session management.
  • Namespaced API: Hierarchical access to protocol endpoints.
  • Lexicon Registry: Auto-generation of type-safe Kotlin models from official schemas.
  • Streaming: Reactive, authenticated WebSocket subscription client.

Getting Started

Installation

Add atpkt to your build.gradle.kts:

dependencies {
    implementation("uk.ewancroft:atpkt:0.1.0")
}

Basic Usage

val agent = AtpAgent()

// Login and Session Management
val session = agent.login("handle.bsky.social", "app-password")
println("Logged in as ${session.did}")

// Using Namespaced API
val profile = agent.app.bsky.actor.getProfile(did = session.did)
println("Display Name: ${profile.displayName}")

Real-time Streaming (Jetstream)

val jetstream = JetstreamClient()
jetstream.subscribe(wantedCollections = listOf("app.bsky.feed.post"))
    .collect { event ->
        println("New Post from ${event.did}: ${event.commit?.record}")
    }

Testing

The SDK includes a comprehensive test suite using Kotest and MockK.
Run tests with:

./gradlew test

Contributing

Please see CONTRIBUTING.md for guidelines on code generation and development workflows.