Download the PHP package agence104/livekit-server-sdk without Composer
On this page you can find all versions of the php package agence104/livekit-server-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download agence104/livekit-server-sdk
More information about agence104/livekit-server-sdk
Files in agence104/livekit-server-sdk
Package livekit-server-sdk
Short Description Server-side SDK for LiveKit.
License MIT
Informations about the package livekit-server-sdk
LiveKit Server API for PHP
PHP APIs to manage rooms and to create access tokens. This library is designed to work with livekit-server. Use it with a PHP backend to manage access to LiveKit.
Installation
Requirements
- php: >= 8
Composer
Usage
Environment Variables
You may store credentials in environment variables. If host, api-key or api-secret is not passed in when creating a RoomServiceClient or AccessToken, the values in the following env vars will be used:
- LIVEKIT_URL
- LIVEKIT_API_KEY
- LIVEKIT_API_SECRET
Creating Access Tokens
Creating a token for participant to join a room.
By default, the token expires after 6 hours. you may override this by passing in ttl
in the access token options. ttl
is expressed in seconds (as number) .
Parsing the Access Tokens
Converting the JWT Token into a ClaimGrants.
Permissions in Access Tokens
It's possible to customize the permissions of each participant:
This will allow the participant to subscribe to tracks, but not publish their own to the room.
Managing Rooms
RoomServiceClient
gives you APIs to list, create, and delete rooms. It also requires a pair of api key/secret key to operate.
Running Tests
We'll utilize Lando to streamline the test execution process. However, should you choose to run the tests on your local environment directly, you can certainly proceed with that approach.
Step 1:
Generate your environment file by duplicating example.dev
and renaming the copy to .env
, then enter your credentials
accordingly.
Step 2:
Start the lando project.
Step 3:
Generate the LiveKit room that will serve as the testing environment for the majority of the test cases.
Step 4:
Initialize 5 test users within the room. Run this command in a separate terminal window.
Step 5:
Time to get busy testing.
Step 6:
Once tests are completed, it is time to clean up.
- End the
lando start-test-users
command. - Run
lando delete-test-room
to delete the test room.
All versions of livekit-server-sdk with dependencies
firebase/php-jwt Version ^6.8
twirp/twirp Version ^0.9.1
google/protobuf Version ^3.23
guzzlehttp/guzzle Version ^6.3|^7.0
guzzlehttp/psr7 Version ^1.6.1|^2.0