PHP SDK
respiresoft/meet for PHP 8.1 or newer, cURL by default or any PSR-18 client.
composer require respiresoft/meetPublishing. The SDK packages are not on npm, PyPI, Packagist or the Go module proxy yet. Until they are, the REST API works from any language over plain HTTPS: every REST reference page has a curl example.
For a task by task start see the server quick start.
Reference from the package README#
Server SDK for the Meet API (rooms, meeting tokens, live control, sessions, recordings, webhooks, usage). PHP 8.1+, no required packages (ext-json; ext-curl for the built-in transport), PSR-4 RespireSoft\Meet\.
composer require respiresoft/meetuse RespireSoft\Meet\Meet;
$meet = new Meet(['apiKey' => getenv('MEET_API_KEY')]); // mk_test_... or mk_live_...
$room = $meet->rooms->create(['name' => 'order-1042', 'privacy' => 'private']);
$token = $meet->rooms->createToken($room['name'], ['name' => 'Ann', 'role' => 'host', 'ttl' => 3600])['token'];
// browser: import { embed } from "@respiresoft/meet-embed"; embed("#meeting", { url: room.url, token });
foreach ($meet->rooms->list() as $r) { echo $r['name']; } // every page, automaticallyResults are plain arrays, request fields are arrays (same field names as the REST API and the Node SDK). Sync only.
Surface (same as the Node SDK, camelCase methods)#
$meet->whoami() |
project and mode of the key |
$meet->rooms |
create list get update delete createToken checkToken presence end eject mute muteAll message updateLive |
$meet->sessions |
list get transcript($id, ['format' => 'json'|'txt'|'vtt'|'srt', 'lang' => ..]) chat |
$meet->recordings |
list get downloadLink delete |
$meet->webhooks |
list create get update delete test rollSecret deliveries listEvents getEvent redeliver |
$meet->usage |
get estimate |
Webhooks::verify($rawBody, $header, $secret, $tolerance = 300) |
Meet-Signature check, no key needed; throws SignatureError. Also constructEvent (verify, then parse) and sign (for your own tests) |
Tokens::verify($token, ['jwksUrl' => .., 'jwks' => .., 'room' => ..]) |
EdDSA check of a meeting token with ext-sodium; pass jwks to stay offline; throws TokenError |
- Lists return a
Page(->data(),->hasMore(),->next());foreachover it walks every page and followsstarting_afterfor you.sessions->transcriptwithtxt,vttorsrtreturns the text as a string. - Retries: 429 (honours
Retry-After, capped at 60 s), 5xx and network errors,maxRetries(default 2) with jittered backoff. Every POST carries anIdempotency-Key(a fresh UUID, the same across retries; pass['idempotencyKey' => '...']as the last argument to choose it). The last argument of every method also takestimeout(seconds) andmaxRetries. - Errors:
MeetErrorwitherrorCode(alsogetErrorCode(); PHP keeps$codefor an int, which holds the HTTP status),status,requestId,param,retryAfter;ConnectionError(status 0) when no answer came;SignatureError,TokenError. - Options:
new Meet(['apiKey', 'baseUrl', 'maxRetries', 'timeout', 'retryBaseDelay', 'transport']). Env fallbacks:MEET_API_KEY,MEET_BASE_URL. - HTTP: curl by default (
CurlTransport). Already have a PSR-18 client?new Meet(['apiKey' => .., 'transport' => new Psr18Transport($client, $requestFactory, $streamFactory)]). Or implement the one-methodTransportinterface.
use RespireSoft\Meet\{Meet, MeetError, SignatureError, Webhooks};
try {
$meet->rooms->get('nope');
} catch (MeetError $e) {
echo "$e->errorCode $e->status $e->requestId"; // room_not_found 404 req_...
}
// Webhook receiver: verify the RAW body, never a decoded and re-encoded array.
$event = Webhooks::constructEvent(file_get_contents('php://input'), $_SERVER['HTTP_MEET_SIGNATURE'] ?? null, getenv('MEET_WEBHOOK_SECRET'));