autotix / php-sdk
Shared PHP core for Autotix framework integrations (Drupal, WordPress, Laravel). Wire format, HTTP client, auth, and utilities — framework-agnostic.
Requires
- php: >=8.1
- psr/http-client: ^1.0
- psr/http-message: ^1.0 || ^2.0
- psr/log: ^1.1 || ^2.0 || ^3.0
Requires (Dev)
- guzzlehttp/guzzle: ^7.0
- phpunit/phpunit: ^10.5 || ^11.0
Suggests
- guzzlehttp/guzzle: Any PSR-18 HTTP client works; Guzzle is the most common (and what Drupal/WP/Laravel ship with).
README
Shared PHP core for the Autotix framework integrations (Drupal, WordPress, Laravel). Wire format, webhook HTTP client, auth, and utilities — framework-agnostic.
Autotix turns production errors into tickets (Jira or GitHub Issues) and AI-generated fix PRs automatically.
This repository is a read-only mirror, split from the Autotix monorepo. Issues and PRs are welcome here and will be applied upstream.
Install
composer require autotix/php-sdk
Requires PHP >= 8.1 and any PSR-18 HTTP client (Guzzle works out of the box and is what Drupal, WordPress, and Laravel ship with).
What's inside
| Class | Purpose |
|---|---|
Autotix\PhpSdk\WebhookClient |
Sends error payloads to the Autotix webhook. JSON encoding, X-Webhook-Token or HMAC-SHA256 auth, debug logging, delivery-outcome recording. |
Autotix\PhpSdk\BacktraceFormatter |
Formats debug_backtrace() output into a stack-trace string. |
Autotix\PhpSdk\UrlExtractor |
Extracts the request URL from the current environment for error attribution. |
Autotix\PhpSdk\StateRecorderInterface |
Optional sink for delivery outcomes (back it with Drupal state, WP options, Laravel cache, …). |
Usage
use Autotix\PhpSdk\WebhookClient; $client = new WebhookClient( $psr18Client, // any PSR-18 ClientInterface $psr17RequestFactory, // PSR-17 RequestFactoryInterface $psr17StreamFactory, // PSR-17 StreamFactoryInterface [ 'auth_method' => 'token', // or 'hmac' 'auth_token' => 'your-org-token', // from app.autotix.io → Settings ], ); $client->send([ 'message' => $exception->getMessage(), 'stack_trace' => $exception->getTraceAsString(), 'url' => 'https://example.com/checkout', 'environment' => 'production', ]);
If you're on Drupal, WordPress, or Laravel, use the corresponding integration instead — they wire all of this up for you.
Development
composer install vendor/bin/phpunit
License
MIT