Options
All
  • Public
  • Public/Protected
  • All
Menu

Rainwave SDK+API Documentation - v1.0.4

API Reference

 

SDK

The SDK provides a typed interface to the public Rainwave Websocket API. It is currently only available in NodeJS environments.

Once connected, the Rainwave SDK instance will emit events from the Rainwave Websocket.

SDK Installation

npm i rainwave-websocket-sdk

SDK Usage

Obtain your own API key and numeric User ID:

Use them with the SDK:

const rw = new Rainwave({
  apiKey: "aaaaaaaaa",
  userId: 2,
  sid: Station.game,
});
rw.on("sched_current", (current) => {
  console.log(`${current.songs[0].albums[0].name} - ${current.songs[0].title}`);
});
await rw.startWebSocketSync();

SDK Examples

Emitted Data By API Every Song Change

The following events are emitted by the API when you connect, and on every song change:

Generated using TypeDoc