Skip to content

Commit 4637dc7

Browse files
committed
Updated README
1 parent f065a06 commit 4637dc7

File tree

1 file changed

+37
-8
lines changed

1 file changed

+37
-8
lines changed

README.md

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# LiveKit Server API for PHP
22

3-
PHP APIs to manage rooms and to create access tokens. This library is designed to work with [livekit-server](https://github.com/livekit/livekit-server). Use it with a PHP backend to manage access to LiveKit.
3+
Use this SDK to interact with [livekit](https://github.com/livekit/livekit-server) server APIs and create access tokens from your PHP Backend.
44

55
## Installation
66

77
### Requirements
8-
- php: >= 8
8+
9+
- php: >= 8.1
910

1011
### Composer
1112

@@ -16,6 +17,7 @@ composer require agence104/livekit-server-sdk
1617
## Usage
1718

1819
### Environment Variables
20+
1921
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:
2022

2123
- LIVEKIT_URL
@@ -47,13 +49,14 @@ $videoGrant = (new VideoGrant())
4749
->setRoomJoin();
4850
->setRoomName($roomName);
4951

50-
// Initialize and fetch the JWT Token.
52+
// Initialize and fetch the JWT Token.
5153
$token = (new AccessToken('api-key', 'secret-key'))
5254
->init($tokenOptions)
5355
->setGrant($videoGrant)
5456
->toJwt();
5557

5658
```
59+
5760
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) .
5861

5962
### Parsing the Access Tokens
@@ -63,8 +66,8 @@ Converting the JWT Token into a ClaimGrants.
6366
```php
6467
use Agence104\LiveKit\AccessToken;
6568

66-
// Initialize and parse the JWT Token.
67-
$claimGrants = (new AccessToken('api-key', 'secret-key'))
69+
// Initialize and parse the JWT Token.
70+
$claimGrants = (new AccessToken('api-key', 'secret-key'))
6871
->fromJwt($token);
6972
```
7073

@@ -111,38 +114,64 @@ $svc->deleteRoom('myroom');
111114
```
112115

113116
### Running Tests
114-
We'll utilize Lando to streamline the test execution process. However, should you choose to run the tests on your local
117+
118+
We'll utilize Lando to streamline the test execution process. However, should you choose to run the tests on your local
115119
environment directly, you can certainly proceed with that approach.
116120

117-
#### Step 1:
118-
Generate your environment file by duplicating `example.dev` and renaming the copy to `.env`, then enter your credentials
121+
#### Step 1:
122+
123+
Generate your environment file by duplicating `example.dev` and renaming the copy to `.env`, then enter your credentials
119124
accordingly.
120125

121126
### Step 2:
127+
122128
Start the lando project.
129+
123130
```
124131
lando start
125132
```
126133

127134
#### Step 3:
135+
128136
Generate the LiveKit room that will serve as the testing environment for the majority of the test cases.
137+
129138
```
130139
lando create-test-room
131140
```
132141

133142
#### Step 4:
143+
134144
Initialize 5 test users within the room. Run this command in a separate terminal window.
145+
135146
```
136147
lando start-test-users
137148
```
138149

139150
#### Step 5:
151+
140152
Time to get busy testing.
153+
141154
```
142155
lando test
143156
```
144157

145158
#### Step 6:
159+
146160
Once tests are completed, it is time to clean up.
161+
147162
- End the `lando start-test-users` command.
148163
- Run `lando delete-test-room` to delete the test room.
164+
165+
<!--BEGIN_REPO_NAV-->
166+
<br/><table>
167+
<thead><tr><th colspan="2">LiveKit Ecosystem</th></tr></thead>
168+
<tbody>
169+
<tr><td>LiveKit SDKs</td><td><a href="https://github.com/livekit/client-sdk-js">Browser</a> · <a href="https://github.com/livekit/client-sdk-swift">iOS/macOS/visionOS</a> · <a href="https://github.com/livekit/client-sdk-android">Android</a> · <a href="https://github.com/livekit/client-sdk-flutter">Flutter</a> · <a href="https://github.com/livekit/client-sdk-react-native">React Native</a> · <a href="https://github.com/livekit/rust-sdks">Rust</a> · <a href="https://github.com/livekit/node-sdks">Node.js</a> · <a href="https://github.com/livekit/python-sdks">Python</a> · <a href="https://github.com/livekit/client-sdk-unity">Unity</a> · <a href="https://github.com/livekit/client-sdk-unity-web">Unity (WebGL)</a></td></tr><tr></tr>
170+
<tr><td>Server APIs</td><td><a href="https://github.com/livekit/node-sdks">Node.js</a> · <a href="https://github.com/livekit/server-sdk-go">Golang</a> · <a href="https://github.com/livekit/server-sdk-ruby">Ruby</a> · <a href="https://github.com/livekit/server-sdk-kotlin">Java/Kotlin</a> · <a href="https://github.com/livekit/python-sdks">Python</a> · <a href="https://github.com/livekit/rust-sdks">Rust</a> · <b>PHP (community)</b> · <a href="https://github.com/pabloFuente/livekit-server-sdk-dotnet">.NET (community)</a></td></tr><tr></tr>
171+
<tr><td>UI Components</td><td><a href="https://github.com/livekit/components-js">React</a> · <a href="https://github.com/livekit/components-android">Android Compose</a> · <a href="https://github.com/livekit/components-swift">SwiftUI</a></td></tr><tr></tr>
172+
<tr><td>Agents Frameworks</td><td><a href="https://github.com/livekit/agents">Python</a> · <a href="https://github.com/livekit/agents-js">Node.js</a> · <a href="https://github.com/livekit/agent-playground">Playground</a></td></tr><tr></tr>
173+
<tr><td>Services</td><td><a href="https://github.com/livekit/livekit">LiveKit server</a> · <a href="https://github.com/livekit/egress">Egress</a> · <a href="https://github.com/livekit/ingress">Ingress</a> · <a href="https://github.com/livekit/sip">SIP</a></td></tr><tr></tr>
174+
<tr><td>Resources</td><td><a href="https://docs.livekit.io">Docs</a> · <a href="https://github.com/livekit-examples">Example apps</a> · <a href="https://livekit.io/cloud">Cloud</a> · <a href="https://docs.livekit.io/home/self-hosting/deployment">Self-hosting</a> · <a href="https://github.com/livekit/livekit-cli">CLI</a></td></tr>
175+
</tbody>
176+
</table>
177+
<!--END_REPO_NAV-->

0 commit comments

Comments
 (0)