# 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
```bash
composer require identify-africa/sdk
```
## Usage
```php
pushHandler(new StreamHandler('php://stdout'));
$client = new Client(
apiKey: getenv('API_KEY'),
apiSecret: getenv('API_SECRET'),
logger: $logger
);
```
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:
```php
[
'success' => bool,
'response_code' => int,
'message' => string,
'data' => ..., // shape depends on endpoint and success/failure
'request_id' => string,
]
```
Check `$result['success']` before relying on `$result['data']`'s shape.
## Error Codes
| Code | Meaning | Retried automatically? |
| ---- | ------------------------------------------------ | ---------------------- |
| 200 | Success …