Packages
atradio_ex
0.1.0
Official Elixir SDK for atradio.fm — a thin wrapper over the atradio_erl NIF package.
Current section
Files
Jump to
Current section
Files
atradio_ex
README.md
README.md
# atradio_ex
[](https://hex.pm/packages/atradio_ex)
[](https://hexdocs.pm/atradio_ex/)




The official **Elixir SDK** for [atradio.fm](https://atradio.fm). A thin wrapper
over the [`atradio_erl`](https://hex.pm/packages/atradio_erl) NIF package (the
shared Rust core) — so the auth / record / reconcile logic is identical to the
Rust, Go, TypeScript, Python, Ruby, Clojure, and Erlang SDKs. `atradio_erl`
downloads the matching native library from the GitHub release on first use, so
there's no Rust toolchain needed to use this package.
## Install
```elixir
# mix.exs
def deps do
[{:atradio_ex, "~> 0.1"}]
end
```
Requires **OTP 27+** (for the `json` module `atradio_erl` uses).
## Usage
```elixir
# Reads — unauthenticated.
Atradio.recent_stations(10) |> Enum.map(& &1["station"]["name"])
Atradio.popular_stations(10)
Atradio.favorites("alice.bsky.social")
# The favorite record key matches every other atradio SDK.
Atradio.favorite_rkey("rb:...") # 16-char hex
# Writes — app-password login (persists a session file). Stations are maps with
# binary keys.
agent = Atradio.login("session.json", "alice.bsky.social", "app-password")
Atradio.favorite(agent, %{
"stationId" => "rb:...", "name" => "KEXP",
"streamUrl" => "https://…", "source" => "radio-browser"
})
Atradio.set_play_status(agent, station)
```
The agent handle is a resource — released automatically by the BEAM GC.