keboola / vault-api-client
Keboola Vault API client
2.0.0
2026-06-22 07:27 UTC
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.5
- keboola/php-api-client-base: *@dev
- monolog/monolog: ^2.0|^3.0
- webmozart/assert: ^1.11
Requires (Dev)
- infection/infection: ^0.27
- keboola/coding-standard: ^15.0
- phpstan/phpstan: ^1.10
- phpstan/phpstan-phpunit: ^1.3
- phpstan/phpstan-webmozart-assert: ^1.2
- phpunit/phpunit: ^9.6
- sempro/phpunit-pretty-print: ^1.4
- symfony/http-client: ^6.3|^7.0
This package is auto-updated.
Last update: 2026-06-22 11:15:50 UTC
README
PHP client for the Keboola Vault API, built on top of keboola/php-api-client-base.
Installation
composer require keboola/vault-api-client
Usage
use Keboola\VaultApiClient\Variables\Model\ListOptions; use Keboola\VaultApiClient\Variables\Model\Variable; use Keboola\VaultApiClient\Variables\VariablesApiClient; $client = new VariablesApiClient( baseUrl: 'https://vault.keboola.com', token: 'your-storage-api-token', ); // Create a variable $variable = $client->createVariable( key: 'MY_SECRET', value: 'secret-value', flags: [Variable::FLAG_ENCRYPTED], attributes: ['branchId' => '123'], ); // List variables $variables = $client->listVariables(new ListOptions(offset: 0, limit: 50)); // List scoped variables for a branch $branchVariables = $client->listScopedVariablesForBranch(branchId: '123'); // Delete a variable $client->deleteVariable(hash: $variable->hash);
Custom configuration
Pass retry, timeout, and logging options directly as constructor parameters:
use Monolog\Logger; $client = new VariablesApiClient( baseUrl: 'https://vault.keboola.com', token: 'your-storage-api-token', backoffMaxTries: 3, logger: new Logger('vault'), );
License
MIT licensed, see LICENSE file.