Guides / How it works

How it works

LiveKit is a horizontally-scalable WebRTC SFU with full-featured SDKs and support across all major browsers and mobile platforms.


  • Horizontally-scalable WebRTC Selective Forwarding Unit (SFU)
  • Modern, full-featured client SDKs for JavaScript, React, Swift, Kotlin, Flutter, Unity (WebGL), and React Native
  • Built for production - JWT authentication and server APIs
  • Robust networking & connectivity over UDP, TCP, and built-in TURN
  • Easy to deploy: pure Go and single binary
  • Advanced features like speaker detection, simulcast, selective subscription, and moderation APIs

Why LiveKit?

WebRTC is a powerful protocol that now has ubiquitous support across all major browsers and mobile platforms. However, building apps with it isn't simple; it requires an understanding of core protocol concepts and developers are responsible for complexities like signaling and coordinating connections between peers. As a peer-to-peer protocol, scaling WebRTC to large numbers of peers also becomes challenging.

While hosted solutions like Twilio and Agora exist, they can be costly, have limited flexibility and as proprietary products, create vendor lock-in. Other open source solutions also exist, but they have a steep learning curve and are daunting to customize and deploy.

We set out to build a free and open source implementation of WebRTC rooms that's easily embeddable within any app. LiveKit provides an opinionated, end-to-end real time communications solution with first-party SDKs for all the major software platforms.


LiveKit is written in Go, using WebRTC implementation from Pion.

LiveKit is horizontally-scalable. You can run it on one node or 100, with an identical configuration. Nodes use peer-to-peer routing via Redis to ensure clients in the same room are connected to the same node.

LiveKit has no external dependencies when running in single-node. Redis is required for a distributed setup spanning multiple nodes.

LiveKit Architecture

Client Examples

import {
} from 'livekit-client'
const url = 'wss://your_host'
const token = 'jwt_token'
const room = new Room({
adaptiveStream: true,
dynacast: true,
// set up listeners
room.on(RoomEvent.TrackSubscribed, (track, publication, participant) => {
attachTrack(track, participant)
await room.connect()
await room.localParticipant.setMicrophoneEnabled(true)
const localPub = await room.localParticipant.setCameraEnabled(true)
if (localPub) {
attachTrack(localPub.track!, room.localParticipant)
function attachTrack(track: Track, participant: Participant) {
// creates a new audio or video element
const element = track.attach()
// find the target element for participant