PHP SDK
PHP client for Keyraft.
Requirements
- PHP 8.2+
- ext-curl, ext-json
Installation
bash
composer require keyraft/php-sdkQuick Start
php
use Keyraft\SDK\Client;
$client = new Client('http://localhost:7200', getenv('KEYRAFT_TOKEN'));
$client->set('myapp/prod', 'DATABASE_URL', 'postgres://...', 'secret');
$entry = $client->get('myapp/prod', 'DATABASE_URL');API Coverage
| Area | Methods |
|---|---|
| Health | health(), metrics() |
| KV | set(), get(), delete(), list(), listVersions() |
| Watch | watch() (long-poll), watchStream() (SSE) |
| Namespaces | listNamespaces(), getNamespace(), deleteNamespace() |
| Auth | me(), createToken(), listTokens(), revokeToken() |
| Roles | listRoles(), getRole() |
| Audit | audit($namespace, $limit, $offset) |
Examples
See the examples/ directory in the repository for more usage patterns.
Repository
github.com/keyraft/php-sdk - Apache License 2.0
