PHP SDK
sentriq/sentriq-php is a server-only SDK — it holds a secret key and must never run in browser-facing code. Not yet published; see the Laravel SDK if you're on Laravel.
Install
composer require sentriq/sentriq-phpInitialize
use Sentriq\Sentriq;
$sentriq = new Sentriq(
secretKey: $_ENV['SENTRIQ_SECRET_KEY'],
);Resources
$sentriq->events()->retrieve($eventId);
$sentriq->events()->list($environmentId, $params = []);
$sentriq->events()->submitOutcome($eventId, ['label' => 'legitimate']);
$sentriq->events()->listOutcomes($eventId);
$sentriq->devices()->retrieve($deviceId);
$sentriq->devices()->list($environmentId);
$sentriq->devices()->trust($deviceId);
$sentriq->devices()->revokeTrust($deviceId);
$sentriq->accounts()->listDevices($environmentId, $externalAccountId);
$sentriq->risk()->list($environmentId, $params = []);
$sentriq->network()->list($environmentId);
$sentriq->webhooks()->verifySignature($rawBody, $timestamp, $signature, $secret);No policies() or webhook management here
Same boundary as every server SDK — see the Node.js SDK docs for the full explanation.
Errors
Sentriq\Exceptions\SentriqException (base)
Sentriq\Exceptions\ConfigurationException
Sentriq\Exceptions\NetworkException
Sentriq\Exceptions\TimeoutException
Sentriq\Exceptions\ApiException
Sentriq\Exceptions\AuthenticationException 401
Sentriq\Exceptions\PermissionException 403
Sentriq\Exceptions\NotFoundException 404
Sentriq\Exceptions\ValidationException 422 — ->getFields()
Sentriq\Exceptions\RateLimitException 429 — ->getRetryAfterSeconds()try {
$sentriq->events()->retrieve($eventId);
} catch (\Sentriq\Exceptions\NotFoundException $e) {
// $e->getRequestId() — include this when contacting support
}Security notes
Never var_dump() or print_r() a Sentriq client in application logs — PHP's debug functions bypass private visibility. Normal code access and json_encode() cannot reach the secret key.
Version compatibility
PHP ^8.2 (tested on 8.4). Guzzle ^7.8.