Integrating with PHP API
Using authaction-php-sdk
Section titled “Using authaction-php-sdk”composer require authaction/authaction-php-sdkuse AuthAction\AuthAction;
$aa = new AuthAction($_ENV['AUTHACTION_DOMAIN'], $_ENV['AUTHACTION_AUDIENCE']);
// Verify from Authorization header — returns null on missing/invalid$user = $aa->verifyRequest($_SERVER['HTTP_AUTHORIZATION'] ?? null);if (!$user) { http_response_code(401); exit; }
echo json_encode(['sub' => $user->sub]);Full SDK reference: github.com/authaction/authaction-php-sdk