rocksky/client

Rocksky SDK for Gleam.

Typed externals over the rocksky_erl NIF package (the shared Rust core, rocksky-sdk): AppView reads, record writes (scrobble, like, follow, shout), and the identity hashes shared across every Rocksky SDK.

Reads use the default AppView (https://api.rocksky.app); the *_at variants take a custom base URL. Envelope calls return Dynamic — an {ok, value} / {error, message} tuple with binary-keyed maps (the wire shape); decode with gleam/dynamic.

Types

An opaque authenticated-agent handle (a NIF resource freed by the BEAM GC).

pub type Agent =
  dynamic.Dynamic

Values

pub fn artist_hash(album_artist: String) -> String

Identity hash of an artist.

pub const default_endpoint: String

The default AppView base URL used by the no-argument read functions.

pub fn follow(
  agent: dynamic.Dynamic,
  did: String,
) -> dynamic.Dynamic

Follow an account by DID.

pub fn global_stats() -> dynamic.Dynamic

Platform-wide totals.

pub fn global_stats_at(endpoint: String) -> dynamic.Dynamic

global_stats against a custom AppView endpoint.

pub fn like(
  agent: dynamic.Dynamic,
  uri: String,
  cid: String,
) -> dynamic.Dynamic

Like a record by strong reference.

pub fn login(
  session_path: String,
  identifier: String,
  password: String,
) -> dynamic.Dynamic

Log in with an app password, persisting the session at session_path.

pub fn profile(actor: String) -> dynamic.Dynamic

An actor’s detailed profile.

pub fn profile_at(
  actor: String,
  endpoint: String,
) -> dynamic.Dynamic

profile against a custom AppView endpoint.

pub fn refresh_session(agent: dynamic.Dynamic) -> dynamic.Dynamic

Proactively refresh the session (keep-alive).

pub fn scrobbles(
  actor: String,
  limit: Int,
  offset: Int,
) -> dynamic.Dynamic

An actor’s scrobbles, newest first.

pub fn scrobbles_at(
  actor: String,
  limit: Int,
  offset: Int,
  endpoint: String,
) -> dynamic.Dynamic

scrobbles against a custom AppView endpoint.

pub fn shout(
  agent: dynamic.Dynamic,
  subject_uri: String,
  subject_cid: String,
  message: String,
) -> dynamic.Dynamic

Post a shout on a subject.

pub fn song_hash(
  title: String,
  artist: String,
  album: String,
) -> String

Identity hash of a song — identical across every Rocksky SDK.

pub fn top_tracks(limit: Int, offset: Int) -> dynamic.Dynamic

Platform-wide top tracks chart.

pub fn top_tracks_at(
  limit: Int,
  offset: Int,
  endpoint: String,
) -> dynamic.Dynamic

top_tracks against a custom AppView endpoint.

Search Document