Installation
Install the PHP client with Composer.
The PHP client is klockwork/klockwork v0.1.0.
composer require klockwork/klockworkIt requires PHP 8.2 or newer, plus the curl and json extensions. The package has no other runtime dependencies.
use Klockwork\Klockwork;
$kw = new Klockwork([
'apiKey' => getenv('KLOCKWORK_API_KEY'),
'baseUrl' => 'https://api.klockwork.org',
]);v0.1.0 sends production requests to https://klockwork.org unless baseUrl is set. These docs call https://api.klockwork.org, so set baseUrl to that host. environment set to local calls http://localhost:3001 instead. baseUrl wins when both are set.
The client sends the key as X-Klockwork-Key. A solo call also sends X-Klockwork-Talent. A company call also sends X-Klockwork-Client. A partner key is a different credential from an agency key. See Authentication.
