PHPackages                             alexstewartja/php-didit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. alexstewartja/php-didit

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

alexstewartja/php-didit
=======================

PHP SDK for Didit's identity verification (KYC) and authentication (CIAM) solutions

1.1.0(1y ago)111[4 PRs](https://github.com/alexstewartja/php-didit/pulls)MITPHPPHP ^8.1 || ^8.2 || ^8.3 || ^8.4CI passing

Since Mar 13Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/alexstewartja/php-didit)[ Packagist](https://packagist.org/packages/alexstewartja/php-didit)[ Docs](https://github.com/alexstewartja/php-didit)[ Fund](https://www.buymeacoffee.com/alexstewartja)[ GitHub Sponsors](https://github.com/alexstewartja)[ RSS](/packages/alexstewartja-php-didit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (6)Used By (0)

[![PHP SDK for Didit KYC/CIAM by alexstewartja on GitHub](https://camo.githubusercontent.com/7f30051e3c57759835b68334ec81f3a1db06d2503720500ae150912b3ca67baa/68747470733a2f2f692e6962622e636f2f634b7a6b4a42724e2f616c6578737465776172746a612d7068702d64696469742e706e67)](https://camo.githubusercontent.com/7f30051e3c57759835b68334ec81f3a1db06d2503720500ae150912b3ca67baa/68747470733a2f2f692e6962622e636f2f634b7a6b4a42724e2f616c6578737465776172746a612d7068702d64696469742e706e67)

  ![Didit Logo](https://camo.githubusercontent.com/9ee0de5ae687c0c43d87f08c6059189c928eb9b29ced340af24063113b4ea98c/68747470733a2f2f646f63732e64696469742e6d652f5f6e6578742f7374617469632f6d656469612f64696469742d6c6f676f2d776f72646d61726b2d626c61636b2e33343739633034332e7376672367682d6c696768742d6d6f64652d6f6e6c79)PHP Didit
=========

[](#php-didit)

[![Latest Stable Version](https://camo.githubusercontent.com/c65ebac8592183449a769c12d2f84158a5e0bb8b9bc3026cd7ede07dcf70a02a/687474703a2f2f706f7365722e707567782e6f72672f616c6578737465776172746a612f7068702d64696469742f76)](https://packagist.org/packages/alexstewartja/php-didit)[![Total Downloads](https://camo.githubusercontent.com/0b55a2db621439807ffa2e157f55d142f06ea77c3d442a830c1df2696bea8d12/687474703a2f2f706f7365722e707567782e6f72672f616c6578737465776172746a612f7068702d64696469742f646f776e6c6f616473)](https://packagist.org/packages/alexstewartja/php-didit)[![License](https://camo.githubusercontent.com/647ee33e63f3d7554bf984fefea04cb240926fe876bca4947a5de04db89e1437/687474703a2f2f706f7365722e707567782e6f72672f616c6578737465776172746a612f7068702d64696469742f6c6963656e7365)](https://packagist.org/packages/alexstewartja/php-didit)

[![Tests Status](https://camo.githubusercontent.com/e9d52c870586e89130d90e42c9901985492b03badc375cdd95c6a07e08a159ea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616c6578737465776172746a612f7068702d64696469742f72756e2d74657374732e796d6c3f6c6162656c3d7465737473)](https://camo.githubusercontent.com/e9d52c870586e89130d90e42c9901985492b03badc375cdd95c6a07e08a159ea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616c6578737465776172746a612f7068702d64696469742f72756e2d74657374732e796d6c3f6c6162656c3d7465737473)[![Static Analysis](https://camo.githubusercontent.com/9f39a3257c217f2e8317e2a43b97a39921e5c251bba0fbc896932b9726c4449f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616c6578737465776172746a612f7068702d64696469742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6c6162656c3d636f64652532307374796c65)](https://camo.githubusercontent.com/9f39a3257c217f2e8317e2a43b97a39921e5c251bba0fbc896932b9726c4449f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616c6578737465776172746a612f7068702d64696469742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6c6162656c3d636f64652532307374796c65)

[![PHP Version Required](https://camo.githubusercontent.com/fab1449d0d56d0a0efb13f6bf015f8f5f99b65f90de3d1c429ab80143b7cfaf9/687474703a2f2f706f7365722e707567782e6f72672f616c6578737465776172746a612f7068702d64696469742f726571756972652f706870)](https://packagist.org/packages/alexstewartja/php-didit)

[![Buy Me A Coffee](https://camo.githubusercontent.com/3ce5cc1c728bf8e0be5bbd132e9d5413d3a922cecfc3381decdcc82c5f66da9b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4275795f4d652d415f436f666665652d6f72616e67653f6c6f676f3d6275792d6d652d612d636f66666565)](https://buymeacoffee.com/alexstewartja)

PHP SDK for [Didit](https://didit.me/business)'s identity verification (KYC) and authentication (CIAM) solutions

Features
--------

[](#features)

- ✅ [Verification](https://docs.didit.me/identity-verification/full-flow)
- ⏳ [Auth](https://docs.didit.me/auth-and-data/sign-in-api-reference/full-flow)
- ⏳ [Data](https://docs.didit.me/auth-and-data/data-api-reference/full-flow)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require alexstewartja/php-didit
```

Usage
-----

[](#usage)

### Get Access Token

[](#get-access-token)

Supply the [Client ID and Client Secret](https://docs.didit.me/identity-verification/quick-start#configure-verification-settings)of your application, from the Didit console:

```
// Replace these example credentials with your own...
$client_id = 'AcL8JK38FqNPmx20qrd3-b';
$client_secret = 'QuajPJsV0sKiQ3M33fd4RK2rVofEmHXLolKW_ZeyeNL';

$token_info = Didit::getAccessToken($client_id, $client_secret);
$access_token = $token_info->getAccessToken();
// Store your access token securely...
```

### Create a Verification Session

[](#create-a-verification-session)

After obtaining a valid client access token, you can then create a new verification session:

```
$access_token = 'eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9...'; // Retrieved from secure storage
$vendor_data = 'c4afad98-e044-4a5f-b68f-5ffaaaefe6a0'; // Commonly, a unique id/uuid of the user in your application
$callback = 'https://verify.didit.me/'; // URL to redirect your user after they complete verification
$features = VerificationFeatures::OCR_FACE; // Optional verification features to enable

$session = Didit::createVerificationSession($access_token, $vendor_data, $callback);
$session_id = $session->getSessionId();
// Store your session ID for future reference, commonly as part of your user record...
$session_url = $session->getSessionUrl();
// Redirect your user to the verification URL...
```

### Retrieve a Verification Session

[](#retrieve-a-verification-session)

Retrieve the results of a verification session by supplying its `session_id`:

```
$access_token = 'eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9...'; // Retrieved from secure storage
$session_id = 'e8933296-fa3b-4a7a-9c99-b132d34b19fc'; // Retrieved from user record

$session = Didit::getVerificationSession($access_token, $session_id);
```

### Update a Verification Session Status

[](#update-a-verification-session-status)

You may approve or decline a verification, by updating its status to `Approved` or `Declined` respectively:

```
$access_token = 'eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9...'; // Retrieved from secure storage
$session_id = 'e8933296-fa3b-4a7a-9c99-b132d34b19fc'; // Retrieved from user record
$new_status = VerificationStatus::DECLINED;
$comment = 'User is from a country that is no longer supported'; // Optional comment/reason for review

$declined = Didit::updateVerificationSessionStatus($access_token, $session_id, $new_status, $comment);
if ($declined) {
    // Status update was successful...
}
```

### Generate a Verification PDF Report

[](#generate-a-verification-pdf-report)

You can generate a PDF for sessions that are either `In Review`, `Declined` or `Approved`:

```
$access_token = 'eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9...'; // Retrieved from secure storage
$session_id = 'e8933296-fa3b-4a7a-9c99-b132d34b19fc'; // Retrieved from user record
$save_to = './session_pdf_downloads/session.pdf'; // Optional file path to store generated PDF

$generated = Didit::generateVerificationSessionPdf($access_token, $session_id, $save_to);
if ($generated) {
    // PDF generated and stored successfully...
}
```

> ℹ️ If no `$save_to` path is supplied, an instance of `Psr\Http\Message\StreamInterface`will be returned, allowing for further processing.

Testing
-------

[](#testing)

1. Navigate to the `tests/assets` directory and copy `credentials.json.example` to `credentials.json`:

    ```
    cp tests/assets/credentials.json.example tests/assets/credentials.json
    ```
2. Open `tests/assets/credentials.json`. Enter your [Client ID and Client Secret](https://docs.didit.me/identity-verification/quick-start#configure-verification-settings)into the `client_id` and `client_secret` fields, respectively.
3. Run the test suite:

    ```
    composer test
    ```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

A [Lando](https://lando.dev/) file is included in the repo to get up and running quickly:

```
lando start
```

Please see [CONTRIBUTING](CONTRIBUTING.md) for more details.

Security
--------

[](#security)

If you discover any security related issues, please email [didit@alexstewartja.com](mailto:didit@alexstewartja.com?Subject=PHP%20Didit) instead of using the issue tracker.

Credits
-------

[](#credits)

- [Alex Stewart](https://github.com/alexstewartja)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 87% of packages

Maintenance76

Regular maintenance activity

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Total

2

Last Release

409d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/082480752bcdbb416813f3ac88ee08dd199e7b05f535f033128e81a33c651be8?d=identicon)[alexstewartja](/maintainers/alexstewartja)

---

Top Contributors

[![alexstewartja](https://avatars.githubusercontent.com/u/6935309?v=4)](https://github.com/alexstewartja "alexstewartja (12 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

kycciamdidit

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/alexstewartja-php-didit/health.svg)

```
[![Health](https://phpackages.com/badges/alexstewartja-php-didit/health.svg)](https://phpackages.com/packages/alexstewartja-php-didit)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M117](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
