PHPackages                             plokko/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. plokko/firebase-php

ActiveLibrary[API Development](/categories/api)

plokko/firebase-php
===================

Firebase API php implementation

0.4.0(1y ago)17105.1k↓25.7%10[2 issues](https://github.com/plokko/firebase-php/issues)1MITPHPPHP &gt;=7.1CI failing

Since Feb 22Pushed 1y ago3 watchersCompare

[ Source](https://github.com/plokko/firebase-php)[ Packagist](https://packagist.org/packages/plokko/firebase-php)[ RSS](/packages/plokko-firebase-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (13)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 plokko/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

42

—

FairBetter than 90% of packages

Maintenance41

Moderate activity, may be stable

Popularity42

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52.9% 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 ~231 days

Recently: every ~132 days

Total

12

Last Release

457d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.6

0.2.2PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3899114?v=4)[plokko](/maintainers/plokko)[@plokko](https://github.com/plokko)

---

Top Contributors

[![andrewalf](https://avatars.githubusercontent.com/u/14373322?v=4)](https://github.com/andrewalf "andrewalf (9 commits)")[![plokko](https://avatars.githubusercontent.com/u/3899114?v=4)](https://github.com/plokko "plokko (4 commits)")[![pety-dc](https://avatars.githubusercontent.com/u/25766885?v=4)](https://github.com/pety-dc "pety-dc (2 commits)")[![tbsmark86](https://avatars.githubusercontent.com/u/10245778?v=4)](https://github.com/tbsmark86 "tbsmark86 (1 commits)")[![thattomperson](https://avatars.githubusercontent.com/u/1112472?v=4)](https://github.com/thattomperson "thattomperson (1 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/plokko-firebase-php/health.svg)](https://phpackages.com/packages/plokko-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)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.3M25](/packages/googleads-googleads-php-lib)[google/grpc-gcp

gRPC GCP library for channel management

18497.8M3](/packages/google-grpc-gcp)[get-stream/stream

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

1451.3M8](/packages/get-stream-stream)

PHPackages © 2026

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