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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

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


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
guzzlehttp/guzzle Version ^7.0
psr/log Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package identify-africa/sdk contains the following files

Loading the files please wait ...