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.
rocksky is a typed, pipe-friendly Gleam client.
At a glance
Every endpoint returns arocksky.Request(a). Refine it with chainable
helpers, then send it through a Client:
Design
- One
Client, one pipe. Build the client once, then every call reads asendpoint(...) |> rocksky.<param>(...) |> ... |> rocksky.send(client). - No
Option(_)at the call site. Required params land in the endpoint constructor; optional params chain as functions on theRequest(a)value. - Builders for body-heavy procedures.
scrobble.create,song.create,shout.create, etc. accept a typed builder. Request(a)is just data. It carries the method, params, headers, body and decoder. You can decorate it (rocksky.headerfor per-request headers) and only atsenddoes the network happen.- Errors are explicit.
RocksyErrordistinguishes transport errors, XRPC errors, raw HTTP failures, and decode failures. - Swappable transport.
rocksky.with_sendlets you plug in your own HTTP function (great for tests; required if you target JavaScript).
Configuration
Builder vocabulary
These helpers live in therocksky module and work on any Request(a):
| Function | XRPC parameter |
|---|---|
rocksky.limit(n) | limit |
rocksky.offset(n) | offset |
rocksky.cursor(c) | cursor |
rocksky.start_date(d) | startDate |
rocksky.end_date(d) | endDate |
rocksky.genre(g) | genre |
rocksky.year(y) | year |
rocksky.size(n) | size |
rocksky.param(name, value) | arbitrary string |
rocksky.int_param(name, value) | arbitrary int |
rocksky.bool_param(name, value) | arbitrary bool |
rocksky.repeated_param(name, vs) | array (repeats key) |
rocksky.header(name, value) | per-request header |
charts.with_artist_uri, graph.with_dids,
player.with_player_id) live in their own module so the global vocabulary
stays small.
Endpoint modules
| Module | Lexicon namespace |
|---|---|
rocksky/actor | app.rocksky.actor.* |
rocksky/album | app.rocksky.album.* |
rocksky/apikey | app.rocksky.apikey.* |
rocksky/artist | app.rocksky.artist.* |
rocksky/charts | app.rocksky.charts.* |
rocksky/dropbox | app.rocksky.dropbox.* |
rocksky/feed | app.rocksky.feed.* |
rocksky/googledrive | app.rocksky.googledrive.* |
rocksky/graph | app.rocksky.graph.* |
rocksky/like | app.rocksky.like.* |
rocksky/mirror | app.rocksky.mirror.* |
rocksky/player | app.rocksky.player.* |
rocksky/playlist | app.rocksky.playlist.* |
rocksky/scrobble | app.rocksky.scrobble.* |
rocksky/shout | app.rocksky.shout.* |
rocksky/song | app.rocksky.song.* |
rocksky/spotify | app.rocksky.spotify.* |
rocksky/stats | app.rocksky.stats.* |
Decoding Dynamic responses
Common views (Profile, Artist, Album, Song, Scrobble, Stats,
Listener, Shout, ApiKey) are typed in rocksky/types. Inline anonymous
shapes (e.g. feed search) are returned as Dynamic so you can decode on your
terms:
Error handling
Types
Most public model types alias the lexicon-derived shapes inrocksky/generated/types, mirroring every lex *View* / *Record / *Input / *Output / *Params shape from the Rocksky lexicons. ApiKey and Shout are hand-written because they carry fields the lexicon does not yet declare. Regenerate with bun run lexgen:types at the repo root.
License
MIT © Tsiry Sandratraina. Source:sdk/gleam.