ararahq/sdk

Official PHP SDK for AraraHQ platform. Simple, typed, and developer-first.

Maintainers

Package info

github.com/ararahq/arara-php-sdk

pkg:composer/ararahq/sdk

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.7.0 2026-02-13 20:26 UTC

This package is auto-updated.

Last update: 2026-02-13 20:30:27 UTC


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