rocketeers-app / rocketeers-api-client
Rocketeers API Client
Requires
- php: >=7.0
Requires (Dev)
- pestphp/pest: ^3.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A lightweight PHP client for the Rocketeers API. Report errors from any PHP application.
Requirements
- PHP 7.0+
Installation
composer require rocketeers-app/rocketeers-api-client
Usage
use Rocketeers\Rocketeers; $client = new Rocketeers('your-api-token'); $client->report([ 'message' => 'Something went wrong', 'level' => 'error', 'context' => ['user_id' => 42], ]);
Redaction
Every report is scrubbed by Rocketeers\Redactor before it is sent, so a credential that ends up
in an exception message, a request payload or a queued job body never leaves the process.
Field names are matched as a substring, lower-cased with dashes normalised to underscores, so
one entry covers a family of names: secret also covers client_secret, token also covers
refresh_token, and api_key also covers X-Api-Key. Credentials with no field name to recognise
them by are matched by shape — private key blocks, Authorization headers, MYSQL_PWD=,
--password=, sshpass -p, SQL IDENTIFIED BY, and credential-shaped query parameters in a URL.
A string holding JSON is decoded and walked rather than matched as one blob.
The report's own field names are never matched, so code stays the HTTP status and cookies stays
the cookie jar; inside request fields (querystring, inputs, headers, cookies, sessions)
code, key and state are treated as credentials too.
Pass extra field names your application uses; the built-in list is never replaced:
use Rocketeers\Redactor; use Rocketeers\Rocketeers; $client = (new Rocketeers('your-api-token'))->setRedactor(new Redactor(['pincode', 'bsn']));
Testing
composer test
Security
If you discover any security related issues, please email mark@vaneijk.co instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.