> ## Documentation Index
> Fetch the complete documentation index at: https://docs.txcloud.thetekcircle.io/llms.txt
> Use this file to discover all available pages before exploring further.

# PHP SDK

> Official TXCloud SDK for PHP

## Installation

```bash theme={null}
composer require txcloud/txcloud-php
```

## Quick Start

```php theme={null}
<?php
require_once 'vendor/autoload.php';

use TXCloud\TXCloud;

$txcloud = new TXCloud(getenv('TXCLOUD_API_KEY'));

$verification = $txcloud->identity->verify([
    'document_front' => $documentBase64,
    'country' => 'MA',
    'document_type' => 'national_id'
]);

echo "Status: " . $verification->status;
```

## Configuration

```php theme={null}
$txcloud = new TXCloud(
    apiKey: getenv('TXCLOUD_API_KEY'),
    environment: 'production',
    timeout: 30
);
```

## Error Handling

```php theme={null}
use TXCloud\Exceptions\ValidationException;
use TXCloud\Exceptions\RateLimitException;

try {
    $result = $txcloud->identity->verify([...]);
} catch (ValidationException $e) {
    echo "Validation failed: " . $e->getMessage();
} catch (RateLimitException $e) {
    echo "Rate limited, retry after: " . $e->getRetryAfter();
}
```
