Client Libraries & SDKs
Speed up development with official SDKs designed with strict typing, robust error handling, native idempotency keys, and webhook cryptographic verification.
Official PHP SDK
The official PHP client recommended for PHP 8.2+ projects. Powers the underlying WHMCS and WordPress integration modules.
composer require cleanhoster/cleanhoster-php
Terminal
- ✓ Strict typing PHP 8.2+ and seamless Bearer token management
- ✓ Cryptographic HMAC-SHA256 signature verification for incoming webhooks
- ✓ Durable idempotency keys required for critical operations
- ✓ Explicit key reuse for safe retries after timeouts
use CleanHoster\Client\CleanHosterClient;
$client = new CleanHosterClient([
'api_key' => 'clh_prod_xxx.secret_token_yyy',
'environment' => 'production', // ou 'sandbox'
]);
// Vérifier la disponibilité d'un domaine
$result = $client->domains()->check('mon-entreprise.com');
if ($result->isAvailable()) {
echo "Domaine disponible au tarif : " . $result->getPriceFormatted();
}
Python SDK
Async Python library designed for automation scripts, DevOps tooling, and Django/FastAPI applications.
pip install cleanhoster
Terminal
- ✓ Full asyncio and httpx support for high throughput
- ✓ Pydantic v2 data validation
- ✓ Complete type hints compatible with mypy
from cleanhoster import CleanHosterClient
client = CleanHosterClient(api_key="clh_prod_xxx.secret_token_yyy")
# Consultation du solde portefeuille revendeur
wallet = client.wallet.get_balance()
print(f"Solde disponible : {wallet.balance_minor / 100} {wallet.currency}")
Node.js & TypeScript SDK
TypeScript and JavaScript client library for Node.js, Next.js, and serverless architectures.
npm install @cleanhoster/sdk
Terminal
- ✓ Comprehensive TypeScript definitions
- ✓ Compatible with Node 18+, Bun, and Deno
- ✓ Dual ESM and CommonJS support
import { CleanHoster } from '@cleanhoster/sdk';
const cleanhoster = new CleanHoster({
apiKey: 'clh_prod_xxx.secret_token_yyy'
});
const order = await cleanhoster.orders.create({
items: [{ productCode: 'DOM-COM-1Y', action: 'create' }]
});
console.log('Commande créée :', order.orderNumber);
CleanHoster Go SDK
Go client library for high-throughput backend services, microservices, and Kubernetes/Terraform integrations.
go get github.com/cleanhoster/cleanhoster-go