mirror of
https://github.com/LukeHagar/plexphp.git
synced 2025-12-06 04:20:51 +00:00
604 B
604 B
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Components;
$security = new Components\Security();
$security->accessToken = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()
->setXPlexClientIdentifier('Postman')
->setSecurity($security)->build();
try {
$response = $sdk->server->getServerCapabilities();
if ($response->object !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}