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 anyapp.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}"))).
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).