Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.rocksky.app/llms.txt

Use this file to discover all available pages before exploring further.

app.rocksky/sdk is an idiomatic Clojure client.
  • Plain maps in, plain maps out — no records, no protocols.
  • Client-first arg — every endpoint threads through ->.
  • No global state — clients are values you can pass around and reuse.
  • Two real verbsquery (GET) and procedure (POST) cover the whole XRPC surface; resource namespaces are thin wrappers on top.

Install

deps.edn:
{:deps {app.rocksky/sdk {:mvn/version "0.2.0-SNAPSHOT"}}}
Leiningen / Boot:
[app.rocksky/sdk "0.2.0-SNAPSHOT"]
Or track a specific commit:
{:deps {app.rocksky/sdk {:git/url   "https://tangled.org/@rocksky.app/rocksky"
                         :git/sha   "..."
                         :deps/root "sdk/clojure"}}}

Quickstart

(require '[rocksky.core :as rs])

(def client (rs/client))   ;; defaults to https://api.rocksky.app

(rs/get-profile client {:did "did:plc:7vdlgi2bflelz7mmuxoqjfcr"})
;; => {:handle "tsiry-sandratraina.com" :followersCount 42 ...}
For authenticated endpoints:
(def client (rs/client {:token (System/getenv "ROCKSKY_TOKEN")}))

(require '[rocksky.scrobble :as scrobble])
(scrobble/create-scrobble client
                          {:title  "Paranoid Android"
                           :artist "Radiohead"
                           :album  "OK Computer"})

Pipe-friendly composition

(require '[rocksky.client :as c]
         '[rocksky.actor  :as actor])

(-> (c/client {:base-url "https://api.rocksky.app"})
    (c/with-token (System/getenv "ROCKSKY_TOKEN"))
    (actor/get-profile {:did "did:plc:7vdlgi2bflelz7mmuxoqjfcr"})
    :handle)
;; => "tsiry-sandratraina.com"
Reshape responses inline:
(require '[rocksky.charts :as charts])

(->> (charts/get-top-tracks (c/client) {:limit 5})
     :tracks
     (map :title))
;; => ("Paranoid Android" "Karma Police" ...)

Calling URLs the SDK doesn’t wrap

(c/query     client :app.rocksky.feed.describeFeedGenerator)
(c/procedure client :app.rocksky.shout.createShout {:message "hi"})

Errors

(try
  (album/get-album client {:uri "at://missing"})
  (catch clojure.lang.ExceptionInfo e
    (let [{:keys [status nsid body]} (ex-data e)]
      (println status nsid body))))

Concurrency

Clients are immutable values — share them across threads:
(pmap #(actor/get-profile client {:did %}) handles)

Available namespaces

NamespaceWraps
rocksky.actorapp.rocksky.actor.*
rocksky.albumapp.rocksky.album.*
rocksky.apikeyapp.rocksky.apikey.*
rocksky.artistapp.rocksky.artist.*
rocksky.chartsapp.rocksky.charts.*
rocksky.dropboxapp.rocksky.dropbox.*
rocksky.feedapp.rocksky.feed.*
rocksky.googledriveapp.rocksky.googledrive.*
rocksky.graphapp.rocksky.graph.*
rocksky.likeapp.rocksky.like.*
rocksky.mirrorapp.rocksky.mirror.*
rocksky.playerapp.rocksky.player.*
rocksky.playlistapp.rocksky.playlist.*
rocksky.scrobbleapp.rocksky.scrobble.*
rocksky.shoutapp.rocksky.shout.*
rocksky.songapp.rocksky.song.*
rocksky.spotifyapp.rocksky.spotify.*
rocksky.statsapp.rocksky.stats.*

Conventions

  • Kebab-case Clojure, camelCase wire. The SDK translates :start-datestartDate, :album-artalbumArt, etc. Raw HTTP bodies still use camelCase, matching the lexicons.
  • Nil values are dropped. Pass :limit nil and the param won’t appear on the wire — handy for cond-> chains.
  • Booleans round-trip. :enabled false is preserved.

Types

Lexicon-derived schemas (in malli form) are exposed as rocksky.generated.types/schemas, a map keyed by :TypeName keywords covering every lex *View* / *Record / *Input / *Output / *Params shape from the Rocksky lexicons. Regenerate with bun run lexgen:types at the repo root.

License

MIT © Tsiry Sandratraina. Source: sdk/clojure.