Search by

vaults / php-client

cranbri

Zero-dependency PHP client for the Vaults resilient Composer infrastructure API

Package info

github.com/vaults-sh/php-client

pkg:composer/vaults/php-client

Statistics

Installs: 23

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

0.1.0 2026-09-08 17:16 UTC

This package is auto-updated.

Last update: 2026-09-08 20:18:20 UTC


README

Zero-dependency PHP client for the Vaults resilient Composer infrastructure API. Shared by the Vaults CLI and the Vaults Composer plugin.

Requires PHP >= 8.2 and ext-json. No other runtime dependencies - by design, so it can live inside any project's vendor tree without conflicts.

Usage

use Vaults\Auth\DeviceFlow;
use Vaults\Auth\TokenStore;
use Vaults\VaultsClient;

$store = new TokenStore;
$client = new VaultsClient($store->token());

$pair = (new DeviceFlow($client))->start(gethostname());
// show $pair->userCode, open $pair->verificationUriComplete in a browser...
$result = (new DeviceFlow($client))->await($pair);

if ($result->isApproved()) {
    $store->save($result->token, $result->team);
}

$run = $client->withToken($result->token)->deposit($projectUuid, file_get_contents('composer.lock'));
  • Base URL: defaults to production; override with the VAULTS_API_URL environment variable or the constructor.
  • Token resolution: VAULTS_TOKEN environment variable first, then ~/.config/vaults/config.json.

Development

composer install
composer test
composer analyse
composer lint