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 (
AccessToken,
Context,
MuteRoomTrackRequest,
RoomServiceClient,
VideoGrant,
)
# 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
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:
$ tox
# or for a specific python version:
$ tox -e py38
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.1.0-1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e7d34b524f91877217bb12f448126e3e4e395b47657502e441a5690e544b9df |
|
MD5 | 9d154ae6985d9c918d051eafae3f364f |
|
BLAKE2b-256 | 8aaf41c49904768ab214fb91a2465481119b833231d8573cda359616a20b8405 |
Close
Hashes for livekit_server_sdk_python-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70f5c8d86e5d03ad5d09547ea0a99156aaabcfd1d2c3630250f797a3b24f8b71 |
|
MD5 | f9ffb9ceb30ae0215cf5ae6822b22cfe |
|
BLAKE2b-256 | 4b36ca6875e8b6e400d082b1cd151aae3bba507f0ac2d55defef11010537dbdb |