Skip to main content
The framework packages wrap @rivi-software/radiotools-sdk in the idiom of each framework. They share the core SDK’s version number; use 0.3.0 or later. Install the binding and the core SDK, because you create the client with the core SDK. All bindings expose the same reads: Each read runs once: when the component mounts in React and Vue, and when you create the store in Svelte. The bindings do not poll; call refresh on the interval from recommendedPollIntervalMs. For anything else, such as schedule, content, track history, the realtime feed, or playback ingest, call the client directly. A browser can follow the feed with subscribePublicFeed without a station key.
Keep station keys on the server. A station key (listener:read) must not ship to the browser. The React, Vue, and Svelte examples below assume code that runs where the key is safe: server rendering, or an app you control. For public pages, use the Next.js server helpers or your own endpoint, and have the browser call that instead.

React

Requires React 18 or newer.
Hooks: useGetStation, useGetCurrentBroadcast, useGetNowPlaying, useGetWeather, useGetTraffic, useRecommendedPollInterval. Each returns { data, error, loading, refresh }. Create the client once, outside components or in a memo, so hooks keep a stable reference.

Vue

Requires Vue 3.4 or newer.
Composables: useGetStation, useGetCurrentBroadcast, useGetNowPlaying, useGetWeather, useGetTraffic, useRecommendedPollInterval. Each returns refs { data, error, loading } and a refresh() function.

Svelte

Requires Svelte 4 or newer.
Stores: createGetStationStore, createGetCurrentBroadcastStore, createGetNowPlayingStore, createGetWeatherStore, createGetTrafficStore, createRecommendedPollIntervalStore. Each store holds { data, error, loading } and has a refresh() method. stationStoreLoading(store) derives a loading-only store.

Next.js

Server helpers for the App Router. Requires Next.js 14.2 or newer. The package imports server-only, so it works only in Server Components, Route Handlers, and Server Actions, and your token never reaches the browser.
Set RADIOTOOLS_BASE_URL, RADIOTOOLS_STATION_SLUG, and RADIOTOOLS_API_TOKEN in the server environment. A Server Component with caching (revalidated every 30 seconds by default):
A Route Handler your browser code can poll:
A cached reader for another method:
Match the revalidation time to the station’s polling policy from recommendedPollIntervalMs; reading more often gains nothing.