ararahq / sdk
Official PHP SDK for AraraHQ platform. Simple, typed, and developer-first.
v1.7.0
2026-02-13 20:26 UTC
Requires
- php: ^8.2
- ext-json: *
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- liip/rmt: ^1.9
- mockery/mockery: ^1.6
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^11.0
README
Official PHP SDK for AraraHQ. Simple, typed, and developer-first.
Installation
composer require ararahq/sdk
Configuration
use Arara\Arara; use Arara\Config; $config = new Config( apiKey: 'sk_live_...', ); $sdk = new Arara($config);
Resources
1. Messages ($sdk->messages)
$response = $sdk->messages->send( receiver: 'whatsapp:+5511999999999', templateName: 'welcome', variables: ['John'] );
2. Templates ($sdk->templates)
$templates = $sdk->templates->list(); $details = $sdk->templates->get('template-name'); $sdk->templates->create([ 'name' => 'promo_christmas', 'category' => 'MARKETING', 'language' => 'pt_BR', 'body' => 'Hi {{1}}, check our Christmas deals!', 'samples' => ['John'] ]); $sdk->templates->delete('template-name');
3. Webhook Events
use Arara\Utils\WebhookUtils; $payload = file_get_contents('php://input'); $data = json_decode($payload, true); if (WebhookUtils::isMessageStatusEvent($data)) { $status = $data['data']['status']; // Handle status update } if (WebhookUtils::isInboundMessageEvent($data)) { $from = $data['data']['from']; $body = $data['data']['body']; // Handle inbound message }
Error Handling
use Arara\Exceptions\AraraException; try { $sdk->messages->send(...); } catch (AraraException $e) { echo "Error {$e->statusCode}: {$e->getMessage()}"; print_r($e->response); }
License
MIT