PHPackages                             codeinc/cloudrun-auth-http-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. [HTTP &amp; Networking](/categories/http)
4. /
5. codeinc/cloudrun-auth-http-client

AbandonedArchivedLibrary[HTTP &amp; Networking](/categories/http)

codeinc/cloudrun-auth-http-client
=================================

A PSR-7 HTTP client based on Guzzle for services hosted on Google Cloud Platform Cloud Run

v1.4(2y ago)0501MITPHPPHP &gt;=8.2

Since Feb 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/codeinchq/cloudrun-auth-http-client)[ Packagist](https://packagist.org/packages/codeinc/cloudrun-auth-http-client)[ Docs](https://github.com/codeinchq/cloudrun-auth-http-client)[ RSS](/packages/codeinc-cloudrun-auth-http-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (6)Used By (1)

GCP Cloud Run authenticated HTTP client for PHP
===============================================

[](#gcp-cloud-run-authenticated-http-client-for-php)

The PHP 8.2+ library is a [PSR-7](https://www.php-fig.org/psr/psr-7/) HTTP client based on [Guzzle](https://github.com/guzzle/guzzle) and the [official Google Auth PHP package](https://packagist.org/packages/google/auth) for services hosted on [Google Cloud Platform Cloud Run](https://cloud.google.com/run?hl=en).

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

[](#installation)

The recommended way to install the library is through [Composer](http://getcomposer.org):

```
composer require codeinc/cloudrun-auth-http-client
```

Usage
-----

[](#usage)

A GCP service account is required to authenticate the requests sent to a Cloud Run service. If you do not already have a service account, follow instructions on [this page](https://cloud.google.com/iam/docs/service-accounts-create) in order to create one.

Before using the library the service account must be authenticated to send requests to the Cloud Run service following [these steps](https://cloud.google.com/run/docs/authenticating/service-to-service#set-up-sa).

```
use CodeInc\CloudRunAuthHttpClient\HttpClientFactory;

// create a new HttpClientFactory instance
$factory = new HttpClientFactory();

// create the client using a JSON file for the service account key
$httpClient = $factory->factory(
    // Cloud Run service URL
    'https://my-service-12345-uc.a.run.app',
    // path to your service account key
    '/path/to/your/service-account-key.json'
);

// create the client using a key stored in memory
$httpClient = $factory->factory(
    // Cloud Run service URL
    'https://my-service-12345-uc.a.run.app',
    // service account key
    [
        'type' => 'service_account',
        // the rest of the service account key
    ]
);

// create the client using a key stored in a environment variable
$httpClient = $factory->factory(
    // Cloud Run service URL
    'https://my-service-12345-uc.a.run.app',
    // service account key
    json_decode(getenv('SERVICE_ACCOUNT_KEY'), true)
);
```

License
-------

[](#license)

The library is published under the MIT license (see [`LICENSE`](LICENSE) file).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

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 ~4 days

Total

5

Last Release

822d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/8f72f949d7f70e400c02c225685f1934dec6219689f25edec38b4037df166d58?d=identicon)[codeinc](/maintainers/codeinc)

---

Top Contributors

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

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/codeinc-cloudrun-auth-http-client/health.svg)

```
[![Health](https://phpackages.com/badges/codeinc-cloudrun-auth-http-client/health.svg)](https://phpackages.com/packages/codeinc-cloudrun-auth-http-client)
```

###  Alternatives

[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

482.5M6](/packages/akamai-open-edgegrid-client)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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