Skip to main content

LiveKit Server SDK

Project description

LiveKit Server SDK

API Reference:


Generate Access Token for a Client

from livekit import AccessToken, VideoGrant

grant = VideoGrant(room_join=True, room="My Cool Room")
access_token = AccessToken("<api key>", "<api secret>", grant=grant, identity="Bob")
token = access_token.to_jwt()

Using RoomServiceClient

from livekit import (

# Create AccessToken with the needed permissions.
grant = VideoGrant(room_admin=True)
access_token = AccessToken("<api key>", "<api secret>", grant=grant)

# Initialize the client.
client = RoomServiceClient("<host>")

# Make a request using the client.
ctx = Context({"Authorization": f"Bearer: {access_token.to_jwt()}"})
request = MuteRoomTrackRequest(room="<room name>", track="<track sid>")
client.MutePublishedTrack(ctx=ctx, request=request)

Local Development


  • golang >= 1.17
  • protoc
    • Ubuntu: sudo apt install protobuf-compiler
  • protoc-gen-twirpy
    • go install
    • make sure ~/go/bin is in your $PATH

Environment Setup:

$ python3 -m venv env
$ source env/bin/activate
$ pip install flit
$ flit install --symlink

Run tests:

$ tox
# or for a specific python version:
$ tox -e py38

Updating protocol

The script pulls the latest tag and builds

$ ./bin/

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

livekit-server-sdk-python-0.1.0-1.tar.gz (30.2 kB view hashes)

Uploaded Source

Built Distribution

livekit_server_sdk_python-0.1.0-py2.py3-none-any.whl (35.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page