PHP SDK

traceiq/traceiq-php for PHP 8.1+ — a zero-dependency Composer package. Events are queued and flushed in batches; PHP has no background threads, so flushing is synchronous at flush_at and on request shutdown.

bash
composer require traceiq/traceiq-php
php
use TraceIQ\Client;

$traceiq = new Client(
    projectId: "YOUR_PROJECT_ID",
    writeKey: "YOUR_WRITE_KEY",
    endpoint: "https://api.traceiq.run",
);

$traceiq->capture(
    event: "payout_succeeded",
    userId: "user_123",
    properties: ["amount" => 50000, "currency" => "NGN"],
);

$traceiq->shutdown(); // flush before a short-lived process exits