Skip to main content
A Kotlin-first client built on Ktor + kotlinx.serialization.
  • Suspending functions, default parameters, builder DSL, AutoCloseable
  • Every endpoint returns a @Serializable data class
  • Every model field is nullable, unknown JSON keys are ignored
  • 4xx / 5xx responses become typed exceptions
  • JVM 17+; bring your own Ktor engine (CIO is the default)

Install

Until artifacts land in Maven Central, build locally with ./gradlew :rocksky:publishToMavenLocal and use mavenLocal().

Quick start

Three styles for create methods

Heavier write endpoints (scrobble.create, song.create, playlist.create, shout.create, apiKey.create) come in three flavors — pick whichever reads best:
Required fields are validated on send() — calling without them throws IllegalStateException before any HTTP call.

Authenticated calls

Swap tokens at runtime: client.setToken("…").

Surface

Errors

Network errors surface as TransportException. Every exception extends RockskyException.

Configuration

Types

Public model types are derived from the Rocksky lexicons and live in app.rocksky.generated. The app.rocksky.Models typealiases re-export them under their historical names; Profile, ApiKey, and FollowList extend with SDK-specific fields. Regenerate with bun run lexgen:types at the repo root.

License

MIT © Tsiry Sandratraina. Source: sdk/kotlin.