Voice AI quickstart
To build your first voice AI app for web, use the following quickstart and the starter app. Otherwise follow the getting started guide below.
Voice AI quickstart
Next.js Voice Assistant
Getting started guide
This guide covers the basics to connect to LiveKit from a JavaScript app.
Install LiveKit SDK
Install the LiveKit SDK:
yarn add livekit-client
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 = '<your LiveKit server URL>';const token = '<generate a token>';const room = new Room();await room.connect(wsURL, token);console.log('connected to room', room.name);// Publish local camera and mic tracksawait room.localParticipant.enableCameraAndMicrophone();
Next steps
The following resources are useful for getting started with LiveKit in a JavaScript app.
Generating tokens
Guide to generating authentication tokens for your users.
Realtime media
Complete documentation for live video and audio tracks.
Realtime data
Send and receive realtime data between clients.
JavaScript SDK
LiveKit JavaScript SDK on GitHub.
React components
LiveKit React components on GitHub.
JavaScript SDK reference
LiveKit JavaScript SDK reference docs.
React components reference
LiveKit React components reference docs.