Skip to main content
rocksky is a stdlib-only Ruby client for the Rocksky API.
Every XRPC NSID maps to a method on a resource object. app.rocksky.actor.getProfile becomes client.actor.get_profile(...). app.rocksky.scrobble.createScrobble becomes client.scrobble.create_scrobble(...). Kwargs in, parsed JSON out.

Install

Requires Ruby 3.0+. Depends only on Ruby’s stdlib (net/http, json, uri).

Quick start

For authenticated calls, pass a bearer token:
with_token derives a new client without mutating the original — handy when a single base client is shared across users in a web app:

Resources

For anything not covered:

Conventions

  • Keyword args for every parameter. Ruby snake_case maps to the lexicon’s camelCase (start_date:startDate).
  • nil is dropped. Pass nil for any optional param and it won’t be sent.
  • Arrays are CSV-joined. Lexicon list params accept Ruby arrays.
  • Hashes in, hashes out. Responses come back as plain Hash (string keys), mirroring the lexicon JSON 1:1.

Errors

Configuration

IRB console

Types

Lexicon-derived Struct types are available under Rocksky::Generated::*, mirroring 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/ruby.