Liking cljdoc? Tell your friends :D

Examples

Runnable scripts that exercise the Rocksky Clojure SDK end-to-end against a real API.

Configuration

Authenticated examples read their bearer token from the environment:

variablepurpose
ROCKSKY_BASE_URLAPI base URL. Defaults to https://api.rocksky.app.
ROCKSKY_TOKENBearer token for authenticated endpoints.

Running

From the sdk/clojure/ directory:

# Run as a one-shot script
clojure -M -e "(load-file \"examples/01_quickstart.clj\")"

# Or from a REPL
clj
user=> (load-file "examples/01_quickstart.clj")

Authenticated examples need a token in the environment:

ROCKSKY_TOKEN=eyJ... clojure -M -e "(load-file \"examples/04_scrobble_a_track.clj\")"

The examples

FileShows
01_quickstart.cljSmallest possible call — fetch a profile, no auth.
02_pipe_friendly.cljBuild → auth → request → reshape in one -> pipeline.
03_paginate_scrobbles.cljLazy seq over an offset-based endpoint.
04_scrobble_a_track.cljAuthenticated POST — submit a scrobble.
05_search_and_listen.cljSearch hits → drill into recent listeners.
06_error_handling.cljCatching ex-info from non-2xx and reading the ex-data.
07_concurrent_requests.cljShare one client across threads with pmap.

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close