rocksky exposes the shared Rocksky Rust core via typed externals over the
rocksky_erl Rustler NIF (rocksky/client module): AppView reads, AT Protocol
PDS writes, and the identity hashes. Targets Erlang.
Install
rocksky 1.6.0 depends on rocksky_erl 0.3.0, whose loader fetches the native
library from the GitHub release on first use.
Quickstart
API
Reads: named readsprofile(actor), scrobbles(actor, limit, offset),
top_tracks(limit, offset), global_stats() — each returns Dynamic. Use the
*_at variants (e.g. global_stats_at(endpoint)) to target a custom AppView. The
universal get(nsid, params_json) escape hatch reaches the whole
app.rocksky.* read catalog by NSID (e.g.
client.get("app.rocksky.album.getAlbums", "{\"limit\":20}"),
"app.rocksky.album.getAlbumTracks", "app.rocksky.graph.getFollows",
"app.rocksky.stats.getStats"); get_authed(nsid, params_json, token) sends a
bearer token for auth-gated queries and get_at(nsid, params_json, endpoint)
targets a custom AppView. Typed date-window charts:
top_tracks_interval(5, 0, client.LastDays(7)) / top_artists_interval where
Interval is AllTime | LastDays(Int) | LastWeeks(Int) | LastMonths(Int) | LastYears(Int) | Range(String, String). match_song(title, artist) resolves a
bare title + artist into full canonical metadata.
Writes: login(session_path, identifier, password), then scrobble (full
metadata) or scrobble_match(agent, ScrobbleMatch(title, artist, album, mb_id, isrc, timestamp)) (match-then-write) — title/artist are String, the rest
Option (album override, mb_id/isrc match anchors, timestamp scrobbled-at
Unix seconds), e.g.
scrobble_match(agent, ScrobbleMatch("Chaser", "Calibro 35", None, None, None, None)) —
like, follow, shout, refresh_session. With a dedup path
set, sync_repo(agent) / hydrate_from_jetstream(agent) keep the dedup + realtime
store warm.
Identity hashes: song_hash(title, artist, album), artist_hash(album_artist).