PHPackages                             nerd4ever/vault-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nerd4ever/vault-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nerd4ever/vault-php
===================

PHP library for Vault

1.0.0(5y ago)05MITPHPPHP ^5.6 || ^7.0 || ^8.0

Since Jul 6Pushed 4y agoCompare

[ Source](https://github.com/nerd4ever/vaultPHP)[ Packagist](https://packagist.org/packages/nerd4ever/vault-php)[ Docs](https://www.mittwald.de/)[ RSS](/packages/nerd4ever-vault-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (6)Used By (0)

PHP Hashicorp Vault Client
==========================

[](#php-hashicorp-vault-client)

[![Tests](https://github.com/mittwald/vaultPHP/workflows/CI%20Tests/badge.svg?branch=master)](https://github.com/mittwald/vaultPHP/workflows/CI%20Tests/badge.svg?branch=master)

PHP Client Library for the Hashicorp Vault Service. This Client follows the Request and Response Data equal to the Hashicorp Vault Client Documentation.

- Authentication
- Secret Engines

Feel free to open Pull Requests to add improvements or missing functionality.

Installation
------------

[](#installation)

### Composer

[](#composer)

`composer require mittwald/vault-php`

Implemented Functionality:
--------------------------

[](#implemented-functionality)

- Auth
    - User/Password
    - Token
    - Kubernetes
- Secret Engines
    - Transit Engine
        - Encrypt/Decrypt
        - Update Key Config
        - Create Key
        - Delete Key
        - List Keys

Basic Usage
-----------

[](#basic-usage)

```
// setting up independent http client
$httpClient = new Client();

// setting up vault auth provider
$auth = new Token('foo');

// creating the vault request client
$client = new VaultClient(
    $httpClient,
    $auth,
    'http://127.0.0.1:8200'
);

// selecting the desired secret engine
// e.g. Transit Secret Engine
$api = new Transit($client);

// calling specific endpoint
$response = $api->listKeys();

//reading results
var_dump($response->getKeys());
//...
//...
//Profit...
```

#### VaultClient

[](#vaultclient)

```
public function __construct(
    HttpClient $httpClient,
    AuthenticationProviderInterface $authProvider,
    string $apiHost
)
```

`HttpClient` takes every PSR-18 compliant HTTP Client Adapter like `"php-http/curl-client": "^1.7"`

`AuthenticationProviderInterface` Authentication Provider from `/authentication/provider/*`

`$apiHost` Hashicorp Vault REST Endpoint URL

Bulk Requests
-------------

[](#bulk-requests)

Using Bulk Requests also requires to iterate through the Response and calling `hasErrors` within the `MetaData` of each Bulk Item to ensure it was processed successfully.

Exceptions
----------

[](#exceptions)

Calling library methods will throw exceptions, indicating where ever invalid data was provided or HTTP errors occurred or Vault Generic Endpoint Errors are encountered.

---

`VaultException`

Generic Root Exception where every exception in this library extends from.

---

`VaultHttpException`

Exception will thrown when something inside the HTTP handling will cause an error.

---

`VaultAuthenticationException`

Will be thrown when API Endpoint Authentication fails.

---

`VaultResponseException`

Will be thrown on 5xx status code errors.

---

`InvalidRouteException`

Calling an Invalid/Non Existing/Disabled Vault API Endpoint will throw this Exception.

---

`InvalidDataException`

Exception indicates a failed server payload validation.

---

`KeyNameNotFoundException`

Will be thrown when trying to request an API Endpoint where the Key Name - that is indicated within the url - will not exist.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 95.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~35 days

Total

5

Last Release

1998d ago

Major Versions

0.0.4 → 1.0.02020-11-26

PHP version history (3 changes)0.0.1PHP &gt;=5.6

0.0.3PHP ^5.6 || ^7.0

0.0.4PHP ^5.6 || ^7.0 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d205c8624c0f8e9a358d99d746d654030cc2ede6248b15d4afef16b5faf4545?d=identicon)[nerd4ever](/maintainers/nerd4ever)

---

Top Contributors

[![ins0](https://avatars.githubusercontent.com/u/2622534?v=4)](https://github.com/ins0 "ins0 (21 commits)")[![sobrito](https://avatars.githubusercontent.com/u/4378335?v=4)](https://github.com/sobrito "sobrito (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nerd4ever-vault-php/health.svg)

```
[![Health](https://phpackages.com/badges/nerd4ever-vault-php/health.svg)](https://phpackages.com/packages/nerd4ever-vault-php)
```

###  Alternatives

[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

343121.4M79](/packages/google-cloud-core)[wallabag/wallabag

open source self hostable read-it-later web application

12.6k2.2k](/packages/wallabag-wallabag)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[wi1dcard/baidu-mini-program-sdk

百度小程序第三方 PHP SDK，助力智能小程序开发。

544.0k1](/packages/wi1dcard-baidu-mini-program-sdk)[php-tuf/php-tuf

PHP implementation of The Update Framework (TUF)

456.5k1](/packages/php-tuf-php-tuf)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
