@ravenkash/server
v0.1.0
Published
Raven server SDK — mint short-lived RTC tokens, manage rooms, and read connection/error diagnostics from your own backend. Never for use in a browser.
Readme
@ravenkash/server
Raven's backend SDK — mint short-lived RTC and chat tokens, manage rooms and live streams, and read connection/error diagnostics.
Part of Raven, open-source real-time communication infrastructure.
Never import this in a browser. It holds a permanent project API key. The browser gets a short-lived token that this SDK mints.
Install
npm install @ravenkash/serverUse
Identity comes from your session — never from the request body, or any caller can claim to be anyone.
import { Raven } from '@ravenkash/server';
const raven = new Raven({ apiKey: process.env.RAVEN_API_KEY! });
const grant = await raven.tokens.create({ room: roomId, identity: 'user-42' });
// grant = { token, endpoint, iceServers, telemetryUrl, expiresAt, ... }Hand grant to your frontend, which passes it to @ravenkash/rtc.
Errors
import { RavenError, isRavenError } from '@ravenkash/server';Every failure carries the API's error code and HTTP status, so you branch on the cause rather than parse a message. Codes are listed in docs/error-codes.md.
Documentation
Python backend? See raven-sdk.
License
MIT
