AD
Boost Your Brand on BlueSky—Exclusive banner space to amplify your reach within the BlueSky community.
BSkyInfo LogoBskyInfo
All ToolsCategoriesCollectionsFeed DirectoryLabeler DirectoryArticlesGuidesGlossaryBluesky SDKsSponsor
Submit
All ToolsCategoriesCollectionsFeed DirectoryLabeler DirectoryGuidesGlossaryArticlesBluesky SDKsSponsorSubmit
  1. SDKs
  2. /Other
  3. /atproto-clj
atproto-clj

atproto-clj

A Other SDK for Bluesky and AT Protocol by atproto-clj

ATProto Clojure SDK

GitHub Stats

12stars
0forks
4contributors
4open issues

Dates

Created:March 21, 2025
Last updated:April 12, 2025

README

The following content is from atproto-clj's GitHub repository. All rights reserved by the original author.

ATProto Clojure SDK

The ATProto Clojure SDK was designed to work in Clojure, ClojureScript, and ClojureDart.

[!CAUTION] Work very much in progress. Do not use in production. The API will likely change before the first release.

Progress

From What goes in to a Bluesky or atproto SDK?:

ComponentClojureClojureScriptClojureDart
Basic
API Client🟢🟢🟡
Lexicon Types🟢🟢🟢
Identifier Syntax🟢🟢🟢
Protocol + Data
Keys and Crypto🟢⭕⭕
MST and Repo⭕⭕⭕
Data model🟡 (no CBOR)🟡 (no CBOR)❓
Lex Validation🟢🟢❓
Identity Resolution🟢🟢❓
Stream client🟢 (Jetstream only)⭕⭕
Service Auth🟡🟡❓
Lex CodegenN/AN/AN/A
PLC Operations⭕⭕⭕
OAuth Backend⭕⭕⭕
Service Pieces
HTTP Server🟡🟡⭕
Identity Directory⭕⭕⭕
Repo Storage⭕⭕⭕
Stream Server⭕⭕⭕
  • ✅ great! complete, documented, examples, accessible to new devs with no atproto experience
  • 🟢 decent. mostly implemented, could point experienced devs at it
  • 🟡 partial progress: incomplete, undocumented, not ergonomic
  • 🚧 early work in progress, but not usable yet
  • ⭕ nothing started
  • 🟣 something exists; not assessed
  • ❓ unknown (need to check status)

We're not currently planning on supporting Bluesky-specific functionalities: post helpers, social graph helpers, label behaviors, preferences.

Usage

Most calls to the APIs are asynchronous, and return immediately. The return value depends on the platform:

  • Clojure: a Clojure promise.
  • ClojureScript: a core.async channel.
  • ClojureDart: a Dart Watchable.

You can also provide a :channel, :callback or :promise keyword option to receive the return value. Not all options are supported on all platforms.

ATProto Client

The ATProto client supports 3 authentication modes:

  • Unauthenticated to make query/procedure calls to public ATProto endpoints
  • Credentials-based authentication to use with your own username/password for CLI tools
  • OAuth to make query/procedure calls on your users' behalf.

You specify the mode when initializing the client.

(require '[atproto.client :as at])

;; Unauthenticated client to public endpoint
(def client @(at/init {:service "https://public.api.bsky.app"}))

;; Bluesky endpoints and their query params can be found here:
;; https://docs.bsky.app/docs/category/http-reference

;; Credentials-based authenticated client
(def client @(at/init {:credentials {:identifier "<me.bsky.social>"
                                     :password "SECRET"}}))

;; For OAuth, see the Statusphere example app

Once the client has been initialized, query and procedure calls can be made against the ATProto service endpoint.

;; Issue a query with the client
@(at/query client {:nsid "app.bsky.actor.getProfile"
                   :params {:actor "<me.bsky.social>"}})

;; => {:handle "<me.bsky.social>" ... }

;; Using core.async
(def result (async/chan))
(at/query client
          {:nsid "app.bsky.actor.getProfile"
           :params {:actor "<me.bsky.social>"}}
          :channel result)
(async/<!! result)

If an error occurs, the response map will contain an :error key containing a short name describing the error. A human-readable message is usually added as well under the :message key.

Jetstream

Connect to Bluesky's Jetstream service to get real-time updates of public network data. Jetstream provides a JSON-based alternative to the binary CBOR firehose, making it easier to work with post streams, likes, follows, and other events.

The Jetstream implementation is currently only supported for JVM Clojure.

(require '[atproto.jetstream :as jet])
(require '[clojure.core.async :as a]))

;; Define a channel to recieve events
(def events-ch (a/chan))

;; Subscribe to the jetstream
(def control-ch (jet/consume events-ch :wanted-collections ["app.bsky.feed.post"]))

;; Consume events
(a/go-loop [count 0]
  (if-let [event (a/<! events-ch)]
    (do
      (when (zero? (rem count 100)) (println (format "Got %s posts" count)))
      (recur (inc count)))
    (println "event channel closed")))

;; Stop processing
(a/close! control-ch)

See the examples directory for more examples.

SDK Organization

The platform-specific functions are under the atproto.runtime namespace. Most of the rest of the code is platform-agnostic.

NamespacePurpose
clientATProto client to make query and procedure calls to ATProto services.
credentialsCredentials-based session to use with the ATProto client.
oauth.clientOAuth 2.0 client for ATProto profile. Create a session that can be used with the ATProto client.
dataATProto data model.
data.jsonJSON-representation of the ATProto data model.
identityIdentity resolution (handles and DIDs).
jetstreamClojure client for Bluesky's Jetstream service.
lexiconSchema definition and validation functions for records, queries, and procedure calls.
runtimeRuntime-specific functions.
tidTimestamp identifiers for records.
xrpc.clientTo make queries and procedure calls to XRPC servers.
xrpc.serverTo implement XRPC servers.

Contribute

Help is very much welcomed!

Before submitting a pull request, please take a look at the Issues to see if the topic you are interested in is already being discussed, and if it is not, please create an Issue to discuss it before making a PR.

License

MIT, see LICENSE file

Related SDKs

itaru2622bluesky-selfhost-env

bluesky self-hosting tool for easy deploy in anywhere.

95•Other
christopherkennybskyr

Interact with Bluesky Social from R

21•Other
feenkcomgt4atproto

A dedicated environment for AT Protocol build in Glamorous Toolkit.

24•Other
camerahackscfbsky

CFML BlueSky API Wrapper

2•Other
mary-extbluesky-embed

Custom element for embedding Bluesky posts and profile feeds

54•Other
mary-extanartia

JavaScript-optional public web frontend for Bluesky.

26•Other

Resources

GitHub Repository

License

MIT

Author

atproto-clj
atproto-clj

Activity

Last commit: April 12, 2025
Commit frequency: Unknown

Our Sponsors

Your Brand Here!

50K+ engaged viewers every month

Limited spots available!

📧 Contact us via email🦋 Contact us on Bluesky
BSkyInfo LogoBskyInfo

The Most Comprehensive Bluesky Tools Directory

Stay updated with the latest Bluesky tools and ecosystem news 🦋

Bluesky butterfly logo
Quick LinksSubmit a ToolSponsorAboutLegal Information
ToolsFeed DirectoryLabeler DirectorySchedulingAnalyticsAll ToolsCategoriesCollectionsTags
ResourcesArticlesBluesky GuidesBluesky GlossaryBluesky SDKsBluesky ResourcesSkyRaffleMeida Coverage
Our ProductsRaffleBlueAiTeach ToolsLaiewAI affiliate listFirsto

This website may contain affiliate links

© 2025 BskyInfo. All rights reserved.