PHPackages                             pantheon-systems/customer-secrets-php-sdk - 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. pantheon-systems/customer-secrets-php-sdk

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

pantheon-systems/customer-secrets-php-sdk
=========================================

Supporting libraries for customer secrets project

1.0.1(2y ago)3414.9k—9.1%2[1 issues](https://github.com/pantheon-systems/customer-secrets-php-sdk/issues)[1 PRs](https://github.com/pantheon-systems/customer-secrets-php-sdk/pulls)2MITPHPPHP ^8.0CI passing

Since Oct 10Pushed 2mo ago5 watchersCompare

[ Source](https://github.com/pantheon-systems/customer-secrets-php-sdk)[ Packagist](https://packagist.org/packages/pantheon-systems/customer-secrets-php-sdk)[ RSS](/packages/pantheon-systems-customer-secrets-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (21)Used By (2)

customer-secrets-php-sdk
========================

[](#customer-secrets-php-sdk)

[![Early Access](https://camo.githubusercontent.com/fad0df4a45ea3acf1140d2d58284c225b6b31ed724f49a5dfe0cff8781bc3844/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50616e7468656f6e2d4561726c795f4163636573732d79656c6c6f773f6c6f676f3d70616e7468656f6e26636f6c6f723d464644433238)](https://docs.pantheon.io/oss-support-levels#early-access) [![Build Status](https://camo.githubusercontent.com/ce8a4640a4c61beedcafee9962e91f34ca683b1a4023e28dfdc1aad354c1a942/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70616e7468656f6e2d73797374656d732f637573746f6d65722d736563726574732d7068702d73646b2f63692e796d6c)](https://github.com/pantheon-systems/customer-secrets-php-sdk/actions/workflows/ci.yml)

This library should be used to access Pantheon Sites Secrets (currently in EA).

Early Access
------------

[](#early-access)

The Secrets feature is available for Early Access participants. Features for Secrets are in active development. Pantheon's development team is rolling out new functionality often while this product is in Early Access. Visit the Pantheon Slack channel (or sign up for the channel if you don't already have an account) to learn how you can enroll in our Early Access program. Please review Pantheon's Software Evaluation Licensing Terms for more information about access to our software.

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

[](#installation)

Use composer to install it:

```
composer require pantheon-systems/customer-secrets-php-sdk

```

Usage
-----

[](#usage)

In your PHP code, do the following:

```
use PantheonSystems\CustomerSecrets\CustomerSecrets;

$client = CustomerSecrets::create()->getClient();
$secret = $client->getSecret('foo');
$secret_value = $secret->getValue();

// You could also get all of your secrets like this:
$secrets = $client->getSecrets();

```

See the included classes and internal documentation for more examples and use cases.

Note: Only get has been implemented so far. You should handle your secrets through terminus using [Terminus Secrets Manager](https://github.com/pantheon-systems/terminus-secrets-manager-plugin).

See our detailed [Drupal](docs/drupal-example.md) or [WordPress](docs/wordpress-example.md) examples for more detailed end to end examples.

### Local Environment Usage

[](#local-environment-usage)

The SDK includes a `CustomerSecretsFakeClient` implementation that is used when the SDK runs outside of Pantheon infrastructure. This client uses a secrets json file to build the secrets information emulating what happens on the platform using the Secrets service.

To get this file, you should use the [plugin](https://github.com/pantheon-systems/terminus-secrets-manager-plugin/) `secret:site:local-generate` command and then set an environment variable into your local environment (or docker container if you are running a dockerized environment) with name `CUSTOMER_SECRETS_FAKE_FILE` and use the absolute path to the file as the value.

#### Lando example

[](#lando-example)

To setup this using lando, you should modify your `.lando.yml` like this:

```
services:
  appserver:
    overrides:
      environment:
          CUSTOMER_SECRETS_FAKE_FILE: /app/secrets.json

```

Then, generate the secrets file like this:

```
terminus secret:site:local-generate --filepath=./secrets.json

```

And rebuild lando application:

```
lando rebuild -y

```

Then, you will be able to use your secrets through the SDK.

Restrictions
------------

[](#restrictions)

This SDK will only read secrets with scope `web`. Secrets get cached in the server for 15 minutes so you should wait (at most) that time if you modified your site secrets.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance50

Moderate activity, may be stable

Popularity42

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 63.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 ~138 days

Total

3

Last Release

952d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a89f5f15357797cbd6ec7833a28626478ae3c0ceb5fa1faa8a26d0960584c65?d=identicon)[pantheon-systems](/maintainers/pantheon-systems)

![](https://www.gravatar.com/avatar/c4f54a034246be4669b54689da9a6a57c4fef369c6ef953b01772c798f75e7f6?d=identicon)[kporras07](/maintainers/kporras07)

---

Top Contributors

[![kporras07](https://avatars.githubusercontent.com/u/2217820?v=4)](https://github.com/kporras07 "kporras07 (66 commits)")[![stovak](https://avatars.githubusercontent.com/u/119924?v=4)](https://github.com/stovak "stovak (25 commits)")[![namespacebrian](https://avatars.githubusercontent.com/u/87093053?v=4)](https://github.com/namespacebrian "namespacebrian (7 commits)")[![greg-1-anderson](https://avatars.githubusercontent.com/u/612191?v=4)](https://github.com/greg-1-anderson "greg-1-anderson (2 commits)")[![jazzsequence](https://avatars.githubusercontent.com/u/991511?v=4)](https://github.com/jazzsequence "jazzsequence (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![vinmassaro](https://avatars.githubusercontent.com/u/969062?v=4)](https://github.com/vinmassaro "vinmassaro (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/pantheon-systems-customer-secrets-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/pantheon-systems-customer-secrets-php-sdk/health.svg)](https://phpackages.com/packages/pantheon-systems-customer-secrets-php-sdk)
```

PHPackages © 2026

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