Download the PHP package identify-africa/sdk without Composer
On this page you can find all versions of the php package identify-africa/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download identify-africa/sdk
More information about identify-africa/sdk
Files in identify-africa/sdk
Package sdk
Short Description PHP SDK for the Identify Africa KYC and identity verification API
License MIT
Informations about the package sdk
identify-africa/sdk
PHP SDK for the Identify Africa KYC and identity verification API. Provides typed, validated access to national ID, alien ID, driving license, vehicle plate, and phone intelligence verification.
Installation
Usage
Responses are returned exactly as sent by the API, unmodified — including both success and error payloads.
Configuration
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
apiKey |
string | Yes | — | Your API key |
apiSecret |
string | Yes | — | Your API secret |
environment |
'sandbox' | 'production' |
No | 'sandbox' |
Which base URL to target |
timeout |
float | No | 10.0 |
Request timeout in seconds |
maxRetries |
int | No | 2 |
Max retry attempts on transient failures |
retryDelay |
float | No | 0.3 |
Base delay (seconds) for exponential backoff |
logger |
Psr\Log\LoggerInterface |
No | — | Optional PSR-3 logger for request/response/retry events |
Store your credentials in your own .env file (loaded with a library like vlucas/phpdotenv) — never commit them to source control:
API_KEY=your_api_key API_SECRET=your_api_secret
Logging
Accepts any PSR-3 compatible logger, such as Monolog:
Sensitive request fields (idnumber, plate, number) are automatically masked in log output (e.g. ****5678). Response data is never logged.
Available Methods
NationalId::verify($client, new NationalIdRequest(idnumber: ...))
Verifies a Kenyan National ID number (8 digits).
AlienId::verify($client, new AlienIdRequest(idnumber: ...))
Verifies an Alien ID number for non-citizens.
DrivingLicense::verify($client, new DrivingLicenseRequest(idnumber: ...))
Looks up driving license details using a National ID number.
VehiclePlate::verify($client, new VehiclePlateRequest(plate: ...))
Verifies vehicle registration details using a number plate.
PhoneIntel::get($client, new PhoneIntelRequest(number: ...))
Retrieves phone intelligence — carrier, spam score, location, and validation details.
Each method validates required input client-side before sending the request, throwing an InvalidArgumentException if validation fails.
Response Shape
Every method returns an associative array matching the API's response envelope:
Check $result['success'] before relying on $result['data']'s shape.
Error Codes
| Code | Meaning | Retried automatically? |
|---|---|---|
| 200 | Success | — |
| 401 | Unauthorized — invalid or missing credentials | No |
| 402 | Low credit balance | No |
| 412 | Validation error (check data for field errors) |
No |
| 424 | Upstream dependency failure | Yes |
| 502 | Upstream service unavailable | Yes |
Development
Built with Guzzle for HTTP and PSR-3 for logging. Tests run with PHPUnit, across PHP 8.1–8.3 in CI.
Release Process
This project follows Semantic Versioning. CI runs the full test suite on every push/PR to main.
Publishing is handled by Packagist, which reads directly from this repository's git tags — there is no separate build/upload step:
Packagist picks up new tags automatically via webhook shortly after pushing.
License
MIT