SDK version
agence104/livekit-server-sdk 1.3.4 (path install from this repo)
PHP 8.2
Laravel 11 app, using the SDK directly
Environment
Env vars:
LIVEKIT_URL=myServerurl.com
LIVEKIT_API_KEY=APILAy*******
_API_SECRET=*************** # redacted, but matches server config
Minimal code to reproduce
use Agence104\LiveKit\RoomServiceClient;
use Agence104\LiveKit\RoomCreateOptions;
$client = new RoomServiceClient( 'myServerurl.com', getenv('LIVEKIT_API_KEY'), getenv('LIVEKIT_API_SECRET'));
$opts = (new RoomCreateOptions())->setName('testRoomFromSdk')->setEmptyTimeout(10)->setMaxParticipants(4);
$room = $client->createRoom($opts);
var_dump($room);
Actual behavior
The call fails with 401:
Client error: POST myServerurl.com/twirp/livekit.RoomService/CreateRoom resulted in a 401 Unauthorized response: invalid token: <JWT...> //
What I’ve already checked
I copied the JWT token generated by sdk to postman
when call API first time return 401 Unauthorized response: invalid token
when call API second time return 200 success response
SDK version
agence104/livekit-server-sdk 1.3.4 (path install from this repo)
PHP 8.2
Laravel 11 app, using the SDK directly
Environment
Env vars:
LIVEKIT_URL=myServerurl.com
LIVEKIT_API_KEY=APILAy*******
_API_SECRET=*************** # redacted, but matches server config
Minimal code to reproduce
Actual behavior
The call fails with 401:
Client error:
POST myServerurl.com/twirp/livekit.RoomService/CreateRoomresulted in a401 Unauthorizedresponse: invalid token: <JWT...> //What I’ve already checked
I copied the JWT token generated by sdk to postman
when call API first time return
401 Unauthorizedresponse: invalid tokenwhen call API second time return
200 successresponse