Rocksky SDK demos across 10 languages — a tour of the AppView read-query API. docs.rocksky.app/sdks/overview
lastfm scrobbling atproto

README.md

Rocksky SDK demos #

Minimal, runnable example projects for every official Rocksky SDK — one per language. Each project installs the published SDK package from its registry and runs the same read-only tour of the AppView query API. No auth required. Every demo touches:

  • platform stats — global_stats
  • a typed date-window chart — top tracks this past week via a DateInterval (LastDays(7)) plus the all-time top artists
  • catalog + drill-down — the album catalog, then one album's tracklist
  • an actor — profile, loved songs, and follows/followers
  • the universal escape hatch — get(nsid, params), which reaches any app.rocksky.* read query by name
  • a Rocksky identity hash

The SDKs are native AT Protocol clients (they read from the AppView and write app.rocksky.* records straight to the user's PDS). See each SDK's own docs for the write side (Agent / app-password login), the local dedup index, and Jetstream real-time sync.

The demos #

Language Package (registry) Install Run
Rust rocksky-sdk (crates.io) cargo build cargo run
TypeScript @rocksky/sdk (npm) bun install bun run index.ts
Python rocksky (PyPI) pip install rocksky python main.py
Go github.com/tsirysndr/rocksky/sdk/go go mod tidy go run .
Ruby rocksky (RubyGems) bundle install ruby demo.rb
Kotlin app.rocksky:rocksky-kotlin (Maven Central) gradle build gradle run
Elixir rocksky_ex (Hex) mix deps.get mix run demo.exs
Erlang rocksky_erl (Hex) rebar3 compile ./demo.escript
Clojure app.rocksky/sdk (Clojars) — clojure -M:run
Gleam rocksky (Hex) gleam deps download gleam run

Each subdirectory has its own README with the exact commands.

Expected output #

global: 493280 scrobbles · 810 users · 402724 tracks

top tracks this week:
  underscores — The Peace
  BTS — 2.0
  System Of A Down — Chop Suey!
  ...

top artists (all-time):
  Linkin Park · 2194 plays
  Gorillaz · 1295 plays
  ...

albums:
  BTS — ARIRANG
  ...
tracks on "ARIRANG":
  1. Body to Body
  2. Hooligan
  ...

actor: tsiry-sandratraina.com
  loved songs: 3
  follows: 42 · followers: 5

get() escape hatch — stats keys: [albums, artists, lovedTracks, scrobbles]

song hash: 8171255408bd5ef33a18ed0a9a42dad4a38926108aef44781509348b1908e584

(Exact numbers drift as people scrobble; the shape is what matters.)

The song hash is identical across every SDK and the server — the SDKs all derive it the same way (sha256(lower("{title} - {artist} - {album}"))).

Remote control #

Each SDK also ships the remote-control surface — build a Rocksky-controllable player or a controller (a remote UI) over the relay WebSocket (see remote-ws/PROTOCOL.md). Every demo has two extra runnable examples that require a ROCKSKY_TOKEN (get one from rocksky login or the Access Tokens screen):

  • player — registers as "Demo Player", advertises a now-playing track, and prints every command a controller sends (play / pause / next / seek / enqueue …).
  • controller — lists your player devices, prints their now-playing / status / queue, and on the first device it sees makes it primary and pauses it.

Run a player in one shell and a controller in another (both scoped to your DID):

Language Player Controller
Rust cargo run --example remote_player cargo run --example remote_controller
TypeScript bun run remote-player.ts bun run remote-controller.ts
Python python remote_player.py python remote_controller.py
Go go run ./remoteplayer go run ./remotecontroller
Ruby ruby remote_player.rb ruby remote_controller.rb
Kotlin gradle runRemotePlayer gradle runRemoteController
Elixir mix run remote_player.exs mix run remote_controller.exs
Erlang ./remote_player.escript ./remote_controller.escript
Clojure clojure -M:remote-player clojure -M:remote-controller
Gleam gleam run -m remote_player gleam run -m remote_controller
export ROCKSKY_TOKEN=<your-access-token>

Notes #

  • Rust, Go, TypeScript need no native library download — Rust and Go compile the client, TypeScript is pure JS (atcute).
  • Python, Ruby, Kotlin, Clojure, Elixir, Erlang, Gleam bind a shared native Rust core. The published packages fetch the matching prebuilt library from the GitHub release on first use (Kotlin bundles it in the jar). Clojure needs JDK 22+ (Panama FFM).