PHPackages                             resgen/lumen-gcp - 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. [Framework](/categories/framework)
4. /
5. resgen/lumen-gcp

ActiveLibrary[Framework](/categories/framework)

resgen/lumen-gcp
================

v1.0.2(6y ago)03[3 PRs](https://github.com/resgen/lib-lumen-gcp/pulls)GPL-3.0+PHPPHP &gt;=7.3

Since Mar 25Pushed 2y ago2 watchersCompare

[ Source](https://github.com/resgen/lib-lumen-gcp)[ Packagist](https://packagist.org/packages/resgen/lumen-gcp)[ RSS](/packages/resgen-lumen-gcp/feed)WikiDiscussions master Synced today

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

Lumen GCP Service Account Provider
==================================

[](#lumen-gcp-service-account-provider)

GCP Service Account authentication provider powered by ENV vars. Base64 decodes Json service account from ENV and puts it down as a usable service account file. Works with multiple GCP service accounts in the ENV aswell.

Requirements
------------

[](#requirements)

- Lumen 5.8+
- ENV var APP\_GCP\_SERVICE\_ACCOUNT with base64 encoded GCP Service Account JSON

Install
-------

[](#install)

With composer:

```
composer require resgen/lumen-gcp:1.0.*
```

Why base64 Json?
----------------

[](#why-base64-json)

Env vars with JSON values are more system universal when they are base64 encoded values. Some systems work fine with json values in ENV vars, some do not.

Kubernetes
----------

[](#kubernetes)

If you are using kubernetes secrets, be sure to double base64 encode the value. This will ensure that the env var will still be base64 encoded inside your pod's ENV.

Basic Example
-------------

[](#basic-example)

Env:

```
# base64 service account json text. example is encoded {'foo':'bar'}
APP_GCP_SERVICE_ACCOUNT=e2ZvbzpiYXJ9
```

Example Code:

```
use Google\Cloud\Storage\StorageClient;
use Resgen\Common\Gcp\GoogleServiceAccountProvider;
use Resgen\Common\Gcp\GoogleServiceAccount;

// omitting Lumen app init...follow their examples

// Register service account in your app
$app->register(GoogleServiceAccountProvider::class);

// Example GCP Storage client usage
$gcpStorageClient = new StorageClient([
    'keyFilePath' => app(GoogleServiceAccount::class)->getFilePath()
]);
```

Multiple Service Accounts Example
---------------------------------

[](#multiple-service-accounts-example)

Env:

```
APP_GCP_ACCOUNTS=APP_GCP_SERVICE_ACCOUNT_ONE,APP_GCP_SERVICE_ACCOUNT_TWO,APP_GCP_SERVICE_ACCOUNT_THREE

# base64 service account json text. example is encoded {'foo':'bar'}
GCP_ACCOUNT_ONE=e2ZvbzpiYXJ9
GCP_ACCOUNT_TWO=e2ZvbzpiYXJ9
GCP_ACCOUNT_THREE=e2ZvbzpiYXJ9
```

Example Code:

```
use Google\Cloud\Storage\StorageClient;
use Resgen\Common\Gcp\GoogleServiceAccountProvider;
use Resgen\Common\Gcp\GoogleServiceAccountBundle;

// omitting Lumen app init...follow their examples

// Register service account in your app
$app->register(GoogleServiceAccountProvider::class);

$gcpAccountBundle = app(GoogleServiceAccountBundle::class);

// Example GCP Storage client usage
$storageAccountOne = new StorageClient([
    'keyFilePath' => $gcpAccountBundle->get('GCP_ACCOUNT_ONE')->getFilePath()
]);

$storageAccountTwo = new StorageClient([
    'keyFilePath' => $gcpAccountBundle->get('GCP_ACCOUNT_TWO')->getFilePath()
]);

$storageAccountThree = new StorageClient([
    'keyFilePath' => $gcpAccountBundle->get('GCP_ACCOUNT_THREE')->getFilePath()
]);
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

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

Unknown

Total

1

Last Release

2290d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9290674bc76dcf2516eb568ac6dd972c9cf77e6f1492fc869b491a2740ba95c1?d=identicon)[philipwhitt](/maintainers/philipwhitt)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/resgen-lumen-gcp/health.svg)

```
[![Health](https://phpackages.com/badges/resgen-lumen-gcp/health.svg)](https://phpackages.com/packages/resgen-lumen-gcp)
```

PHPackages © 2026

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