package atproto

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

AT Protocol for OCaml

Atproto is a typed OCaml client for the AT Protocol. Use it to resolve identities, read and write repositories, follow the firehose, and call AppView, Ozone, and hosted Bluesky products (chat, video, Jetstream).

1.0.2 is the packaged surface. Until atproto.1.0.2 lands on opam-repository, pin the GitHub repository; after it is published, opam install atproto. The narrative guide — install, quick start, hosted-product paths, and honest gaps — is the GitHub README. Release notes are in CHANGELOG.md. Public-internet live tests skip unless ATP_PUBLIC=1. Default opam install -t / @runtest stay offline.

Start here

opam pin add atproto git+https://github.com/david-engelmann/atproto.git
(* after atproto.1.0.2 is on opam-repository: opam install atproto *)
let did = (Identity.resolve_handle "jay.bsky.team").did
let posts = Feed.search_posts ~q:"atproto" ~limit:5 ()

Those two OCaml lines need the public network (no ATP_AUTH). ATP_PUBLIC only gates tests, not this example.

Then (libraries atproto) in dune. Requires OCaml >= 4.14.1 and < 5.4 (CI: 4.14.1 and 5.3.0). Jetstream dict-zstd needs system libzstd (libzstd-dev / Homebrew zstd).

What this library is

A client and protocol library: XRPC, lexicons (pinned at f0d4877a03), CID / CAR / MST, OAuth / DPoP, and typed helpers for AppView, Ozone, chat, and video.

It does not host a PDS, chat backend, video transcoder, Tap, SMS gateway, or APNs/FCM:

  • Atproto.Oauth builds a public HTTPS client-metadata document and drives authorize → code → token. Your application still hosts that URL and the redirect.
  • Atproto.Chat talks to hosted chat.bsky.* on api.bsky.chat (atproto-proxy or service-auth; DPoP cannot be proxied).
  • Atproto.Video talks to hosted app.bsky.video.* on video.bsky.app (service-auth did:web:<pds> + uploadBlob).
  • Atproto.Repo_sync is an indexer / backfill toolkit, not a Tap host.
  • Atproto.Jetstream archive HTTP needs an operator-supplied JETSTREAM_API_KEY. Live subscribe stays unauthenticated.
  • Atproto.Contact and Atproto.Notification registerPush are clients for hosted SMS / a caller push gateway.

Experimental proposal-0016 modules (Atproto.Lt_hash, Atproto.Space_commit, Atproto.Space_credential, Atproto.Space_xrpc, Atproto.Space_sync) are not a spaces product API. There is no space host in this package.

Public modules

Auth / Session

XRPC

Identity / PLC

MST / CID / CAR / indexer

Experimental permissioned-data (proposal 0016; not a spaces product)

TID / AT URI / syntax

Firehose / Jetstream

OAuth / DPoP

AppView

Ozone

Admin / temp / moderation

Chat client

Also Atproto.Repo, Atproto.Records, Atproto.Server, Atproto.Sync, Atproto.Label, Atproto.Lexicon, Atproto.Http_client, and Atproto.Germnetwork.