LiveKit LogoDocs

Quickstart Guides / Clients / JavaScript

JavaScript Quickstart

On this page

1. Install LiveKit SDK2. Join a room3. Create a backend server to generate tokens

1. Install LiveKit SDK

Install the LiveKit SDK:

yarn add livekit-client

2. Join a room

Note that this example hardcodes a token. In a real app, you’ll need your server to generate a token for you.

import { Room } from 'livekit-client';
const wsURL = "<wsURL>"
const token = "<token>"
const room = new Room();
await room.connect(wsURL, token);
console.log('connected to room',;
// publish local camera and mic tracks
await room.localParticipant.enableCameraAndMicrophone();

3. Create a backend server to generate tokens

Use our Server SDKs to create a backend server than generates tokens for your app at runtime:


Chevron IconUnity (web)
LiveKit logo