PHPackages                             amos97/firebase-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. [API Development](/categories/api)
4. /
5. amos97/firebase-php

ActiveLibrary[API Development](/categories/api)

amos97/firebase-php
===================

Firebase API php implementation

6.0.0(4y ago)0111MITPHPPHP &gt;=5.6

Since Feb 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Amos97/firebase-php)[ Packagist](https://packagist.org/packages/amos97/firebase-php)[ RSS](/packages/amos97-firebase-php/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)Dependencies (3)Versions (7)Used By (1)

Firebase php
============

[](#firebase-php)

Php implementation of Firebase API.

Why
---

[](#why)

This package is built to be simple, scalable and configurable to allow easy integration in other packages or frameworks (ex: [laravel-firebase](https://github.com/plokko/laravel-firebase) ).

This package uses `google/auth` to generate OAuth2.0 tokens from the service account and `guzzlehttp/guzzle` as http library.

Install
-------

[](#install)

Install it with composer via

`composer require amos97/firebase-php`

Usage
-----

[](#usage)

All the calls on the API are made using a Firebase OAuth2.0 token, this token is generated using your ServiceAccount informations.

### Service Account

[](#service-account)

To use the API you need to authenticate the requests with your service account: this is done by the `ServiceAccount` class that uses your Firebase ServiceAccount json credential file. You can download your service account json file from the Firebase console in settings &gt; service accounts, keep in mind to store this file in a secure non-public location.

```
use Plokko\Firebase\ServiceAccount;

//Use one of those methods:
$sa = new ServiceAccount('/path/to/your/serviceaccount/file.json');
$sa = new ServiceAccount('{"type":"service_account",..............}');
$sa = new ServiceAccount(['type'=>'service_account',/*...*/]);
```

Accepted methods for the constructor are:

- string: ServiceAccount file content (json string)
- string: path to the serviceAccount json file
- array: php-translated array of the service account content

You can also add a token cache handler via the `setCacheHandler` method that accepts an implementation of `CacheItemPoolInterface` to allow custom cache integrations.

see [google/auth MemoryCacheItemPool](https://github.com/google/google-auth-library-php/blob/master/src/Cache/MemoryCacheItemPool.php) for an example implementation:

```
$handler = new Google\Auth\Cache\MemoryCacheItemPool\MemoryCacheItemPool();
$sa->setCacheHandler($handler);
```

### FCM

[](#fcm)

This package implements FCM Http v1 Api

[see FCM docs](docs/FCM.md)

### Real time database

[](#real-time-database)

This package includes the Firebase Real time database API integration

[see Real time database docs](docs/DB.md)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 64.3% 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 ~250 days

Recently: every ~313 days

Total

6

Last Release

1754d ago

Major Versions

0.1.4 → 6.0.02021-07-28

### Community

Maintainers

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

---

Top Contributors

[![andrewalf](https://avatars.githubusercontent.com/u/14373322?v=4)](https://github.com/andrewalf "andrewalf (9 commits)")[![Amos97](https://avatars.githubusercontent.com/u/11861901?v=4)](https://github.com/Amos97 "Amos97 (5 commits)")

### Embed Badge

![Health badge](/badges/amos97-firebase-php/health.svg)

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

###  Alternatives

[google/apiclient

Client library for Google APIs

9.8k191.4M997](/packages/google-apiclient)[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.3M25](/packages/googleads-googleads-php-lib)[newerton/google-api-php-client

Client library for Google APIs

9.8k23.4k](/packages/newerton-google-api-php-client)[get-stream/stream

A PHP client for Stream (https://getstream.io)

1451.3M8](/packages/get-stream-stream)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)

PHPackages © 2026

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