LiveKit LogoDocs

Quickstart Guides / Backend / Python (community)

Python Backend Quickstart

On this page

1. Install Livekit Server SDK2. Keys and Configuration3. Generate access token for a client4. Create a client app to connect

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 livekit
grant = 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:

Previous

Chevron IconRuby
LiveKit logo

Product

SFU

SDKs

Performance

Deployment