@ravenkash/rtc
v0.5.0
Published
Official browser SDK for the Livqeno hosted platform — join a room, publish camera/microphone, subscribe to remote media. Hides SDP/ICE/STUN/TURN/SFU behind a small typed API.
Downloads
673
Readme
@ravenkash/rtc
Livqeno's browser RTC SDK — join a room, publish camera and microphone, subscribe to remote media. Hides SDP, ICE, STUN, TURN and the media server behind a small typed API.
Part of Livqeno, open-source real-time communication infrastructure.
Install
npm install @ravenkash/rtcUse
The token and endpoint come from your own backend — never mint them in a
browser. See @ravenkash/server
or Livqeno's Python SDK for Python (not on PyPI yet — will
publish as livqeno-sdk).
import { createRTCClient } from '@ravenkash/rtc';
// `grant` is your backend's RTC token-mint response, forwarded verbatim.
// It already carries the endpoint, the ICE servers and the room, so there
// is nothing here to configure and no URL to hand-build.
const client = createRTCClient(grant);
const room = await client.join();
// Spelling out the same thing, if you prefer to be explicit:
// const client = createRTCClient({
// token: grant.token,
// endpoint: grant.endpoint, // Livqeno's signaling WebSocket
// iceServers: grant.iceServers, // never hand-build STUN/TURN config
// });
// const room = await client.join(grant.roomName);
await room.enableCamera();
await room.enableMicrophone();
room.on('trackSubscribed', (track) => {
document.body.appendChild(track.attach());
});join() resolves once the control plane admits you. You can publish
immediately, but ICE and DTLS finish a moment later — render from the
connected event rather than assuming:
room.on('connected', () => setStatus('live'));
// or, if you must block: await room.waitUntilConnected();Exports
createRTCClient, RTCClient, Room, Participant,
LocalParticipant, RemoteParticipant, Track, LocalTrack,
RemoteTrack, RTCError, isRTCError.
Documentation
- Browser SDK reference
- RTC architecture
- Signaling protocol
- What is and is not tested
- Runnable examples:
video-call
React?
Use @ravenkash/react —
headless hooks over this package, with optional components.
License
MIT
