KingRTCKitDocs

Get startedInstall an SDK

Install an SDK

Install the KingRTCKit server SDK on your backend and a client SDK in your app, set up TypeScript and environment variables, and check that everything is wired up.

Every KingRTCKit app installs two packages: a server SDK on your backend, which holds the API key and mints tokens, and a client SDK in your app, which uses a token to join a call, a chat, or a live stream.

Quick start

  1. Install the server SDK in your backend project.
  2. Install the client SDK in your app project.
  3. Set KINGRTCKIT_API_KEY and KINGRTCKIT_API_URL where your backend runs.

In your backend project:

pnpm add @kingrtckit/server

In your app project:

pnpm add @kingrtckit/rtc

That is the whole install for a web video call. The rest of this page covers the other platforms, the system requirements, and how to check your setup. Already installed? Go straight to the Quickstart.

System requirements

Before you begin, make sure your environment meets these minimums:

PackageRequirement
@kingrtckit/serverNode.js 20 or later
livqenoPython 3.10 or later (tested on 3.10 to 3.13)
@kingrtckit/reactReact 18 or 19
@kingrtckit/react-nativeReact Native 0.73 or later, react-native-webrtc 124 or later
livqeno_rtc, livqeno_chat, livqeno_liveFlutter 3.27 or later (Dart 3.6), Android minSdkVersion 24, iOS 13

KingRTCKit is hosted, so there are no servers, media relays, or databases to install. Your backend only needs outbound HTTPS to https://api.livqeno.com.

Supported browsers

The browser packages (@kingrtckit/rtc, @kingrtckit/chat, @kingrtckit/live, @kingrtckit/react) need three browser features: RTCPeerConnection, navigator.mediaDevices.getUserMedia, and WebSocket. Chat needs only WebSocket.

BrowserFeature checkTested end to end with real media
Chrome / Edge (Chromium)PassesYes
FirefoxPassesNo
Safari (macOS and iOS)PassesNo

Check support at runtime with isBrowserSupported() before you show a call screen. Learn more in Browser support.

Install with the CLI

The quickest way to set up a JavaScript project is the KingRTCKit CLI. It links the folder to your project, detects your package manager from the lockfile (pnpm-lock.yaml, yarn.lock, bun.lock, or package-lock.json), and installs @kingrtckit/rtc with it.

Terminal
npm install -g @kingrtckit/cli
kingrtckit config set apiUrl https://api.livqeno.com   # once: the CLI defaults to localhost
kingrtckit login                                       # opens your browser
kingrtckit init                                        # link this folder to a project
kingrtckit sdk install                                 # install @kingrtckit/rtc

kingrtckit init asks you to pick a project and writes a swalvo.json file in the current folder, so everyone who runs livqeno there uses the same project. Commit it: it holds only the project id, never a secret.

To see the install command without running it:

Terminal
kingrtckit sdk install --dry-run

Manual installation

Install the server SDK

Run this in your backend project. Pick your server's language. Not on TypeScript, Python or Go? Call the REST API directly from any language.

pnpm add @kingrtckit/server

@kingrtckit/server ships ESM and CommonJS builds and its own TypeScript types, so both import and require work with no extra setup.

Install the client SDK

Run this in your app project. Pick the platform your users are on.

pnpm add @kingrtckit/rtc

That's enough for calls. For other products, install the matching package:

You wantInstallImport
Calls only@kingrtckit/rtccreateRTCClient
Chat only@kingrtckit/chatcreateChatClient
Calls and chat (or live streaming)@kingrtckit/livecreateKingRTCKit

@kingrtckit/rtc and @kingrtckit/chat don't depend on each other, so a calls-only app never ships chat code.

Set up environment variables

Your backend needs two values. Store them in your environment or secrets manager, never in source control:

.env
KINGRTCKIT_API_KEY=rvk_dev_...                 # from the dashboard or `kingrtckit keys create`
KINGRTCKIT_API_URL=https://api.livqeno.com
VariableWhat it's for
KINGRTCKIT_API_KEYProves a request comes from your backend. One key per environment.
KINGRTCKIT_API_URLWhere the SDK sends requests.

The server SDKs don't read environment variables on their own. Pass both values in yourself when you create the client, once at startup:

lib/kingrtckit.ts
import { KingRTCKit } from '@kingrtckit/server';
 
export const kingrtckit = new KingRTCKit({
  apiKey: process.env.KINGRTCKIT_API_KEY!,
  baseUrl: process.env.KINGRTCKIT_API_URL!,
});

Set up TypeScript

Every JavaScript package ships its own type declarations. There is nothing extra to install, and no @types/* package to add.

Most types you need come from the package you call. For example, the grant your backend returns and the room your app joins are both typed:

app/call.ts
import { createRTCClient } from '@kingrtckit/rtc';
 
const grant = await fetch('/join-room', { method: 'POST' }).then((r) => r.json());
const client = createRTCClient(grant);
const room = await client.join(grant.roomName); // typed Room

Errors are typed too: every SDK throws an error with message, code and requestId, never a raw DOMException or HTTP body. On the server, narrow with isKingRTCKitError:

lib/kingrtckit.ts
import { isKingRTCKitError } from '@kingrtckit/server';
 
try {
  await kingrtckit.rooms.list();
} catch (error) {
  if (isKingRTCKitError(error)) console.error(error.code, error.requestId);
  throw error;
}

Use with Next.js

A Next.js app holds both halves, so it installs both packages:

pnpm add @kingrtckit/server @kingrtckit/rtc @kingrtckit/react

Keep each package on its side of the boundary:

Project structure
app/
├── api/
│   └── join-room/
│       └── route.ts      ← @kingrtckit/server and your API key (server only)
└── call/
    ├── page.tsx          ← Server Component, renders the client component
    └── call-client.tsx   ← 'use client' — @kingrtckit/rtc / @kingrtckit/react
lib/
└── kingrtckit.ts          ← the one shared KingRTCKit instance
  • A Route Handler is server code, so it's the right place for @kingrtckit/server and KINGRTCKIT_API_KEY.
  • @kingrtckit/rtc, @kingrtckit/chat, and every @kingrtckit/react hook run only in the browser. Use them in a file marked 'use client', and never call createRTCClient() during server rendering.

The full walkthrough is in Next.js. See also React.

Check your setup

With the CLI

From a folder linked with kingrtckit init, run:

Terminal
kingrtckit dev

It checks that the folder is linked to a project, the API is reachable, the media servers are up, and @kingrtckit/rtc is in your package.json:

Terminal
KingRTCKit project:
my-video-app
Project ID:
16281d1e-5b0c-4f3e-9a51-7d2c8e4b9a10
 
API:
✓ Connected
 
RTC:
✓ Available
 
SDK:
✓ @kingrtckit/rtc installed
 
Environment:
development
 
Ready for development.

From your backend

Make one authenticated call with your key. If it returns, the key, the URL and the network path are all correct:

scripts/check-kingrtckit.ts
import { KingRTCKit } from '@kingrtckit/server';
 
const kingrtckit = new KingRTCKit({
  apiKey: process.env.KINGRTCKIT_API_KEY!,
  baseUrl: process.env.KINGRTCKIT_API_URL!,
});
 
const rooms = await kingrtckit.rooms.list();
console.log(`Connected. ${rooms.length} room(s) in this environment.`);

A LIVQENO_AUTH_ERROR (401) means the key is wrong or revoked. A connection error usually means KINGRTCKIT_API_URL is unset and the SDK is calling localhost.

Which package do I need?

PackageRuns onUsesReference
@kingrtckit/serverYour TypeScript backendAPI keyTypeScript
livqenoYour Python backendAPI keyPython
github.com/atulsinghhhh/swalvo-sdks/sdks/go/livqenoYour Go backendAPI keyGo
@kingrtckit/rtcBrowserRTC tokenNext.js
@kingrtckit/chatBrowserChat tokenNext.js
@kingrtckit/liveBrowserBoth tokens, one objectKingRTCKit Client
@kingrtckit/reactBrowser (React)Hooks for RTC and chatReact
@kingrtckit/react-nativeiOS, AndroidRTC and chatReact Native
livqeno_rtc, livqeno_chat, livqeno_liveiOS, Android (Flutter)RTC, chat, streamingFlutter
@kingrtckit/cliYour terminalYour dashboard loginCLI

Upgrade your SDKs

Every SDK is before version 1.0, so a minor release can change an API. Read the Changelog before you upgrade, and upgrade the server and client packages together.

pnpm add @kingrtckit/server@latest @kingrtckit/rtc@latest

Next steps