1. Install LiveKit SDK
Install the LiveKit SDK:
yarn add livekit-client @livekit/components-react
npm install livekit-client @livekit/components-react --save
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 { LiveKitRoom, VideoConference } from '@livekit/components-react';const wsURL = "<wsURL>"const token = "<token>"export function App() {return (<LiveKitRoom token={token} serverUrl={wsURL} connect={true}><VideoConference /></LiveKitRoom>);}
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: