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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 588a894ee58260cd285c12cfb0f85055cdbe789f3d9623f853dfe06a5a65cd41 |
|
MD5 | 3b0fe7e3cf76fc5d24edda49e3890af5 |
|
BLAKE2b-256 | 1831fe1d58336da9f0b491b5f765f0188dd6b1e6f3759a4dbd3e1dfbf8b43898 |
Close
Hashes for livekit_server_sdk_python-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9d2e9661d04cf05d851e502edad60648fd33b7a053bb49635d6c979503c86f0 |
|
MD5 | 73b9a81b5f890d49539bf6244697100f |
|
BLAKE2b-256 | 748c701b937288ecc3e17487797ab2fc9327547189b4226d16ef3aaf624c901a |