RetackSDK is a PHP library for integrating with Retack AI's error reporting service.
You can install the RetackSDK via Composer:
composer require retack/retack-sdkFirst, initialize the RetackSDK with your Environment key:
use Retack\RetackSDK;
$retackSDK = new RetackSDK('your_environment_key_here');To report an error asynchronously:
$error = "An error occurred";
$stackTrace = new Exception("Sample exception");
$userContextExtras = ['username' => exampleuser ];
$result = $retackSDK->reportErrorAsync($error, $stackTrace, $userContextExtras);
if ($result) {
echo "Error reported successfully";
} else {
echo "Failed to report error";
}