1. Install Livekit Server SDK
Install using pip:
pip install livekit-server-sdk-python
2. Keys and Configuration
Create a new file at development.env
and with your API Key and Secret:
export LIVEKIT_API_KEY=<API Key>export LIVEKIT_API_SECRET=<API Secret hidden>
3. Generate access token for a client
import livekitgrant = livekit.VideoGrant(room_join=True, room="My Cool Room")access_token = livekit.AccessToken(os.environ("LK_API_KEY"), os.environ("LK_API_SECRET"), grant=grant, identity="bob", name="Bob")token = access_token.to_jwt()
4. Create a client app to connect
Create a client app that fetches a token from the server you just made, then uses it to connect to a LiveKit room: