PHPackages                             eelkevdbos/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. [HTTP &amp; Networking](/categories/http)
4. /
5. eelkevdbos/firebase-php

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

eelkevdbos/firebase-php
=======================

Firebase php wrapper for REST API

0.1.3(11y ago)7728.8k↓50%31[2 issues](https://github.com/eelkevdbos/firebase-php/issues)[1 PRs](https://github.com/eelkevdbos/firebase-php/pulls)MITPHPPHP &gt;=5.4CI failing

Since Jun 9Pushed 10y ago10 watchersCompare

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

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

firebase-php
============

[](#firebase-php)

[![Build Status](https://camo.githubusercontent.com/49e5dd6597b332981ff07434429f2120560f84f8330b4f2b4e83ef9cd13a7544/68747470733a2f2f7472617669732d63692e6f72672f65656c6b657664626f732f66697265626173652d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/eelkevdbos/firebase-php) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/82fa8f4053a0424274868bf51d113128ac4fb05428c1ce39830a4108e70aae28/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f65656c6b657664626f732f66697265626173652d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/eelkevdbos/firebase-php/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/de36375ae000307c73b55722b834fa8b6712e52e0854be759b28418e58f9c007/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f65656c6b657664626f732f66697265626173652d7068702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/eelkevdbos/firebase-php/?branch=master)

Firebase php wrapper for REST API

\##Prerequisites

- PHP &gt;= 5.4
- Firebase &gt;= 1.1.1
- Composer (recommended, not required)

Installation using composer (recommended)
-----------------------------------------

[](#installation-using-composer-recommended)

Set your projects minimum stability to `dev` in `composer.json`. This is caused by the PHP-JWT dependency. After updating the composer.json file, simply execute: `composer require eelkevdbos/firebase-php dev-master`

\##Installation without composer For a vanilla install, the following dependencies should be downloaded:

- firebase/php-jwt [github](https://github.com/firebase/php-jwt/releases/tag/v1.0.0)
- guzzlehttp/guzzle [github](https://github.com/guzzle/guzzle/releases/tag/5.0.3)

Loading the dependencies can be achieved by using any [PSR-4 autoloader](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader-examples.md).

Basic Usage
-----------

[](#basic-usage)

By setting your firebase secret as token, you gain superuser access to firebase.

```
use Firebase\Firebase;

$fb = Firebase::initialize(YOUR_FIREBASE_URL, YOUR_FIREBASE_SECRET);

//or set your own implementation of the ClientInterface as second parameter of the regular constructor
$fb = new Firebase([ 'base_url' => YOUR_FIREBASE_BASE_URL, 'token' => YOUR_FIREBASE_SECRET ], new GuzzleHttp\Client());

//retrieve a node
$nodeGetContent = $fb->get('/node/path');

//set the content of a node
$nodeSetContent = $fb->set('/node/path', array('data' => 'toset'));

//update the content of a node
$nodeUpdateContent = $fb->update('/node/path', array('data' => 'toupdate'));

//delete a node
$nodeDeleteContent = $fb->delete('/node/path');

//push a new item to a node
$nodePushContent = $fb->push('/node/path', array('name' => 'item on list'));
```

Advanced Usage
--------------

[](#advanced-usage)

For more finegrained authentication, have a look at the [security rules](https://www.firebase.com/docs/security/security-rules.html). Using the token generator allows you to make use of the authentication services supplied by Firebase.

```
use Firebase\Firebase;
use Firebase\Auth\TokenGenerator;

$tokenGenerator = new TokenGenerator(YOUR_FIREBASE_SECRET);

$token = $tokenGenerator->generateToken(['email' => 'test@example.com'])

$fb = Firebase::initialize(YOUR_FIREBASE_BASE_URL, $token);
```

The above snippet of php interacts with the following security rules:

```
{
  "rules": {
    ".read": "auth.email == 'test@example.com'"
    ".write": "auth.email == 'admin@example.com'"
  }
}

```

And will allow the snippet read-access to all of the nodes, but not write-access.

\##Concurrent requests Execution of concurrent requests can be achieved with the same syntax as regular requests. Simply wrap them in a Closure and call the closure via the `batch` method and you are all set.

```
use Firebase\Firebase;

$fb = Firebase::initialize(YOUR_FIREBASE_BASE_URL, YOUR_FIREBASE_SECRET);

$requests = $fb->batch(function ($client) {
    for($i = 0; $i < 100; $i++) {
        $client->push('list', $i);
    }
});

$pool = new GuzzleHttp\Pool($fb->getClient(), $requests);
$pool->wait();
```

Integration
-----------

[](#integration)

At the moment of writing, integration for Laravel 4.\* is supported. A service provider and a facade class are supplied. Installation is done in 2 simple steps after the general installation steps:

1. edit `app/config/app.php` to add the service provider and the facade class

```
    'providers' => array(
      ...
      'Firebase\Integration\Laravel\FirebaseServiceProvider'
    )

    'aliases' => array(
      ...
      'Firebase' => 'Firebase\Integration\Laravel\Firebase'
    )

```

2. edit `app/config/services.php` (supplied by default from L4.2) to add `token` and `base_url` settings

```
    'firebase' => array(
      'base_url' => YOUR_FIREBASE_BASE_URL,
      'token' => YOUR_FIREBASE_SECRET
    )

```

\##Eventing

The library supports the EventEmitter pattern. The event-emitter is attached to the Firebase class. Events currently available:

- RequestsBatchedEvent

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.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 ~111 days

Total

4

Last Release

4029d ago

### Community

Maintainers

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

---

Top Contributors

[![eelkevdbos](https://avatars.githubusercontent.com/u/1001306?v=4)](https://github.com/eelkevdbos "eelkevdbos (67 commits)")[![michaeldim](https://avatars.githubusercontent.com/u/1141848?v=4)](https://github.com/michaeldim "michaeldim (1 commits)")

---

Tags

restwrapperfirebase

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[ktamas77/firebase-php

Firebase PHP Client

7881.8M10](/packages/ktamas77-firebase-php)[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.3M14](/packages/xeroapi-xero-php-oauth2)[gnikyt/basic-shopify-api

A basic Shopify API wrapper with REST and GraphQL support, powered by Guzzle.

245514.8k5](/packages/gnikyt-basic-shopify-api)[zoonman/linkedin-api-php-client

LinkedIn API PHP SDK with OAuth 2.0 &amp; CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.

127704.0k](/packages/zoonman-linkedin-api-php-client)

PHPackages © 2026

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