@radion-app/sdk is the TypeScript SDK. It ships both ESM and CommonJS builds and brings its own types. It has few dependencies — just ws and zod. Needs Node.js 18+.
Usage
import { Radion } from "@radion-app/sdk";
const radion = new Radion({ apiKey: process.env.RADION_API_KEY });
await radion.realtime.connect();
radion.realtime.subscribe({ id: "trading", channel: "trading" });
radion.realtime.onChannel("trading", (event) =>
console.log(event.id, event.data)
);
Modules
Both module systems load from the package exports:
import { Radion } from "@radion-app/sdk"; // ESM
const { Radion } = require("@radion-app/sdk"); // CommonJS
Standalone realtime client
If you only need the stream, import RealtimeClient on its own:
import { RealtimeClient } from "@radion-app/sdk";
const client = new RealtimeClient({ apiKey: process.env.RADION_API_KEY });
await client.connect();
Exports
| Export | Kind |
|---|
Radion, RealtimeClient | classes |
RadionError, RadionConnectionError, RadionServerError | errors |
CHANNELS, isChannel | values |
Channel, Subscription, ChannelFilters, ChannelEvent | types |
RadionOptions, RealtimeOptions, ReconnectOptions, HeartbeatOptions | option types |
onChannel(name, …) narrows event.data to that channel’s typed payload. For the catch-all events() stream, use ChannelEvent<T> to set the payload type.
Examples
You can find ready-to-run Node.js + TypeScript examples for every channel in the WebSocket examples.Last modified on July 5, 2026