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(headers={"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.1-1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47a6cfd408344a1f8d7264980001f48b1b1766d4f20d1118a3e4167d5151e252 |
|
MD5 | 41dc5f0d0b3f632bc121e6a6478ce04a |
|
BLAKE2b-256 | 46e9cb20c70bb4c2bbac6b0f7430d7d27e48cc69a7ce9f9ff5275fde1957effc |
Close
Hashes for livekit_server_sdk_python-0.1.1-1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 537d29a4efd83e1a8fcb78f3ba8fcc352edc56c6ddade1dde0c7781ae29dc13e |
|
MD5 | dbe95b84f5b072ab4f256d96160c9dbe |
|
BLAKE2b-256 | a2b292c57945d61a03cf27138c2f4fb01d8826b84b3495d0f505636189bcddbf |