VDO.Ninja SDK — API Reference

Tip: avoid reserved SDK types (subscribe | unsubscribe | channelMessage) for custom protocols.

For detailed option and event payloads, see the Markdown API reference.

Constructor

const vdo = new VDONinjaSDK(options)

Connection

Publishing

Viewing

Quick Helpers

Data Communication

Native File and Resource Transfer

Pub/Sub

Utilities & Aliases

TypeScript

Browser and Node declarations ship with the package; no separate @types package is required. The root, /browser, and /node exports each resolve the matching declarations.

Events (Selected)

WHIP/WHEP Clients

Standalone clients for standard WebRTC-HTTP streaming protocols. Works independently of the VDO.Ninja P2P system.

WHIPClient (whip-client.js)

Publish media streams to WHIP-compatible endpoints (Twitch, Meshcast, Cloudflare, etc.)

const client = new WHIPClient(endpoint, options)

Methods:

Events: connecting, connected, icestate, connectionstate, error, disconnected, stopped

WHEPClient (whep-client.js)

Consume media streams from WHEP-compatible endpoints.

const client = new WHEPClient(endpoint, options)

Methods:

Events: connecting, connected, track, icestate, connectionstate, error, disconnected, stopped

Supported Services

See README and demos for examples.