PHPackages                             kidfund/thin-transit-client - 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. [Security](/categories/security)
4. /
5. kidfund/thin-transit-client

ActiveLibrary[Security](/categories/security)

kidfund/thin-transit-client
===========================

Lightweight PHP wrapper around Hashicorp Vault Transit

1.0.0(7y ago)0251[1 issues](https://github.com/Kidfund/ThinTransitClient/issues)MITPHPPHP ~7.0CI failing

Since Dec 7Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Kidfund/ThinTransitClient)[ Packagist](https://packagist.org/packages/kidfund/thin-transit-client)[ Docs](https://github.com/Kidfund/ThinTransitClient)[ RSS](/packages/kidfund-thin-transit-client/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (6)Versions (4)Used By (0)

ThinTransitClient
=================

[](#thintransitclient)

[![Latest Version on Packagist](https://camo.githubusercontent.com/283ee65c4ce5733edd86454b4be662830d4680c5862d795b040ed46629905560/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b696466756e642f7468696e2d7472616e7369742d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kidfund/thin-transit-client)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/d186d13656e345b28916d2f87f6f69bc8450be90e254fac13290e952b40f6e67/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6b696466756e642f7468696e2d7472616e7369742d636c69656e742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/kidfund/thin-transit-client)[![StyleCI](https://camo.githubusercontent.com/a74fd533693f66a9a5d03516b16130c0cf62811a0dbd01b44ff888439b38afab/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3135373930373834322f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/157907842)[![Total Downloads](https://camo.githubusercontent.com/1868ea071df0703c54249f49eb371cc32126a40c667df6d8fa7168420c9c443b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b696466756e642f7468696e2d7472616e7369742d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kidfund/thin-transit-client)

- [ThinTransitClient](#thintransitclient)
    - [What this is](#what-this-is)
    - [What this isn't](#what-this-isnt)
- [Install](#install)
- [Usage](#usage)
    - [Setup](#setup)
    - [Encrypting](#encrypting)
    - [Decrypting](#decrypting)
- [Testing](#testing)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

What this is
------------

[](#what-this-is)

A very thin PHP wrapper around Hashicorp Vault's [Transit Engine](https://www.vaultproject.io/docs/secrets/transit/index.html)

What this isn't
---------------

[](#what-this-isnt)

Unfortunatly, this isn't a full fledged vault client. When I started writing [LaraVault](https://github.com/Kidfund/LaraVault), [these clients](https://www.vaultproject.io/api/libraries.html#php) didn't exist yet. This client is the bare minimum need to communicate with Transit. Ideally, LaraVault would deprecate the need for this and use one of those clients

Install
=======

[](#install)

Via Composer

```
$ composer require kidfund/thin-transit-client
```

Usage
=====

[](#usage)

Setup
-----

[](#setup)

You'll need to store the address of your vault server and the currently available token somewhere. This is the token setup we use with LaraVault

```
path "transit/decrypt/*" {
  capabilities = ["create", "update"]
}

path "transit/encrypt/*" {
  capabilities = ["create", "update"]
}
```

If we were using the TransitClient in a Laravel Service Providor, we could do something like this

```
/**
 * @return TransitClient|null
 * @throws Exception
 */
protected function getTransitClient()
{
    $enabled = config('vault.enabled');

    if (!$enabled) {
        return null;
    }

    $vaultAddr = config('vault.addr');
    $vaultToken = config('vault.token');

    if ($vaultToken === null || $vaultToken === 'none') {
        throw new Exception('Vault token must be configured');
    }

    $client = new TransitClient($vaultAddr, $vaultToken);

    return $client;
}

/**
 * @return void
 */
public function register()
{
    $this->app->singleton(TransitClient::class, function () {
        return $this->getTransitClient();
    });
}
```

Encrypting
----------

[](#encrypting)

```
$encrypted = $client->encrypt($key, $plaintext);
```

You can also pass a context

```
$encrypted = $client->encrypt($key, $plaintext, $context);
```

Decrypting
----------

[](#decrypting)

```
$plaintext = $client->decrypt($key, $cipherText,);
```

You can also pass a context

```
$plaintext = $client->decrypt($key, $cipherText, $context);
```

Testing
=======

[](#testing)

```
$ ./vendor/bin/phpunit
```

Contributing
============

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Credits
=======

[](#credits)

- [@timborder](https://github.com/timbroder)

License
=======

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~3 days

Total

3

Last Release

2755d ago

Major Versions

0.9.1 → 1.0.02018-12-14

PHP version history (3 changes)0.9.0PHP ~5.5|~7.0

0.9.1PHP 5.5.9

1.0.0PHP ~7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/121503?v=4)[Tim Broder](/maintainers/timbroder)[@timbroder](https://github.com/timbroder)

---

Top Contributors

[![timbroder](https://avatars.githubusercontent.com/u/121503?v=4)](https://github.com/timbroder "timbroder (14 commits)")

---

Tags

vaulthashicorpkidfundthin-transit-client

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kidfund-thin-transit-client/health.svg)

```
[![Health](https://phpackages.com/badges/kidfund-thin-transit-client/health.svg)](https://phpackages.com/packages/kidfund-thin-transit-client)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9772.3M123](/packages/roots-acorn)[spatie/laravel-export

Create a static site bundle from a Laravel app

673139.5k6](/packages/spatie-laravel-export)[dgtlss/warden

A Laravel package that proactively monitors your dependencies for security vulnerabilities by running automated composer audits and sending notifications via webhooks and email

9056.1k](/packages/dgtlss-warden)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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