PHP 8.2 or later, no Composer runtime dependencies. It uses ext-curl when available and PHP streams otherwise.
Install
Section titled “Install”composer require ohauthcat/ohauthcat-php:0.0.2- Create a client:
new OhAuthCatClient(.getenv( 'OHAUTHCAT_API_KEY'), 'pk_. . . ') - Call any API operation, for example
$client->, or iterateorganizations-> getOrganization( 'org_. . . ') listDirectoryUsersAutoPaging(.. . . ) - SSO:
$client->returnsssoHelpers-> getAuthorizationUrl( $redirectUri, domain: 'customer. com') urlandcodeVerifier; then$client->.ssoHelpers-> getProfileAndToken( $code, $verifier, $redirectUri) - Webhooks:
Webhooks:.: verify( file_get_contents( 'php: / / input'), $_SERVER['HTTP_OHAUTHCAT_SIGNATURE'] ? ? null, $secret) - Errors are
OhAuthCatExceptionsubclasses, such asNotFoundExceptionandRateLimitedException, with the stable$errorCode. - To use a PSR-18 HTTP client such as Guzzle, pass
transport: new OhAuthCat\Psr18Transport(.. . . )