atproto_client

Alpha. Pre-1.0 and evolving alongside at-record; expect breaking changes between 0.x releases.

A small, transport-agnostic atproto client for Gleam. No app or lexicon knowledge: XRPC, identity resolution, OAuth discovery, blobs, and generic repo CRUD. Modules live under the atproto/ namespace.

Transport injection

The client carries a send function instead of a hardcoded HTTP backend, so it compiles on both erlang and javascript and you choose the backend:

import atproto/xrpc
import gleam/httpc
import gleam/result
import gleam/string

let client =
  xrpc.Client(send: fn(req) {
    httpc.send(req) |> result.map_error(string.inspect)
  })

Modules

ModuleWhat it does
atproto/xrpcClient, XrpcError, get/post_json, parse.
atproto/identityresolve_pds (handle/DID -> PDS) via Slingshot resolveMiniDoc.
atproto/authcreate_session (com.atproto.server.createSession).
atproto/repolist_records/create_record/delete_record, generic over a row decoder.
atproto/uriat-uri helpers (rkey).

Development

gleam test
Search Document