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

1.1.0 2026-01-27 14:22 UTC

This package is auto-updated.

Last update: 2026-01-27 14:44:20 UTC


README

ProtegeId Logo

ProtegeId PHP SDK

PHP SDK for integrating with the ProtegeId API (Age Verification).

codecov PHPStan PHP Version License: MIT

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\ConfigException for invalid configuration.
  • ProtegeId\Exceptions\ValidationException for invalid method input.
  • ProtegeId\Exceptions\ApiException for 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.