PHP SDK
The sangho/sangho-php SDK supports
PHP 8.0+ with an object-oriented interface. Compatible with Laravel,
Symfony, and any standard PHP project.
Installation
Configure your API key via the static method Sangho::setApiKey(). In production, use environment
variables rather than hardcoded values.
With Laravel, publish the config file via php artisan vendor:publish –provider=“Sangho\SanghoServiceProvider”,
then set SANGHO_SECRET_KEY in your .env. The Sangho:: facade is
automatically available in all your controllers.
Initialization
Error handling
All exceptions inherit from Sangho\Exception\SanghoException. Use subclasses to
differentiate business cases.
Pagination
List endpoints return a ListObject with properties count, data, and has_more. Use page and page_size to navigate.
The SDK automatically retries 429 and 5xx errors with exponential backoff. Configure via Sangho::setMaxNetworkRetries(3).