protege-id / php-client
ProtegeId PHP SDK
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/protege-id/php-client
Requires
- php: >=8.2
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/php-code-coverage: ^10.1
- phpunit/phpunit: ^10.5
- squizlabs/php_codesniffer: ^4.0
This package is auto-updated.
Last update: 2026-01-27 14:44:20 UTC
README
ProtegeId PHP SDK
PHP SDK for integrating with the ProtegeId API (Age Verification).
Requirements
- PHP 8.2+
Installation
composer require protege-id/php-client
Basic usage
<?php use ProtegeId\ProtegeIdClient; use ProtegeId\Exceptions\ApiException; use ProtegeId\Exceptions\ConfigException; use ProtegeId\Exceptions\ValidationException; try { $client = new ProtegeIdClient('your-api-key'); $session = $client->createSession( userRef: 'user-123', returnUrl: 'https://yoursite.com/path-to-return', metadata: ['additional' => 'infos'] ); $verification = $client->verifySession('user-123'); } catch (ValidationException | ConfigException | ApiException $e) { echo $e::class . ': ' . $e->getMessage() . PHP_EOL; }
Exceptions
ProtegeId\Exceptions\ConfigExceptionfor invalid configuration.ProtegeId\Exceptions\ValidationExceptionfor invalid method input.ProtegeId\Exceptions\ApiExceptionfor API errors.
Testing and code quality
Run the test suite:
./vendor/bin/phpunit
Run the PHPCS code style checks:
./vendor/bin/phpcs
Run the PHPStan static analysis:
vendor/bin/phpstan analyse
Generate code coverage (requires Xdebug or PCOV enabled):
composer test:coverage
The HTML report is generated in build/coverage/.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Support
For questions, issues, or to request an API key, please contact:
ProtegeId Sales Team Email: vendas@protegeid.com.br
For bug reports and feature requests, please use the GitHub Issues page.
