LiveKit Server SDK
Project description
LiveKit Server SDK
API Reference: https://docs.livekit.io/guides/server-api
Examples
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 RoomServiceClient
client = RoomServiceClient("<host>", "<api key>", "<api secret>")
client.mute_published_track(room="<room name>", track="<track sid>")
Local Development
Dependencies
- golang >= 1.17
- protoc
- Ubuntu:
sudo apt install protobuf-compiler
- Ubuntu:
- protoc-gen-twirpy
go install github.com/verloop/twirpy/protoc-gen-twirpy@latest
- 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:
The RoomServiceClient
tests require a running LiveKit server.
See the LiveKit Getting Started page.
The tests use the following environment variables to locate the LiveKit server.
export LIVEKIT_HOST='http://localhost:7880'
export LIVEKIT_API_KEY='<api key>'
export LIVEKIT_API_SECRET='<api secret>'
Run the tests:
$ pytest
Updating protocol
The build.sh
script pulls the latest tag and builds
$ ./bin/build.sh
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for livekit-server-sdk-python-0.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e45f7c963e55f4d3b68f2604d4e013aed8ea063c91df3db76911e8f9be54783d |
|
MD5 | 188c7b0b55836d0afd01c26e8568e2ca |
|
BLAKE2b-256 | 63a076e8d296c95d687bf92257950674b2f20b7d81976eaee8b209b938ff75f0 |
Close
Hashes for livekit_server_sdk_python-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e02ca7913a8a7eb97d3c698341a6bc89294c29a754fdd3bf7a70225953e62b8c |
|
MD5 | c5bb78589f4072120295dda3b96b199b |
|
BLAKE2b-256 | 3db1e67c51517211d5d0eec63ad3c15ca4e8f377664ca2b100d638ce6aa70957 |