atproto_client

Alpha, pre-release. Pre-1.0, 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. Dual-target (erlang + javascript); browser-only consumers want the sibling atproto_browser instead, which owns the atproto/browser/* namespace within the shared atproto/ prefix.

Installation

gleam add atproto_client

Usage

The client carries a send function instead of a hardcoded HTTP backend, so you choose the transport per target:

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)
})

Architecture

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