Firebase Admin SDK for PHP

This Admin SDK makes it easy to interact with Google Firebase from PHP applications.

The source code can be found at


If you are interested in using a client for end-user access (for example, in a Node.js desktop or IoT application), as opposed to admin access from a privileged environment (like a server), you should instead follow the instructions for setting up a Firebase client SDK.


require __DIR__.'/vendor/autoload.php';

$firebase = (new Firebase\Factory)

$database = $firebase->getDatabase();

$newPost = $database
        'title' => 'Post title',
        'body' => 'This should probably be longer.'

$newPost->getKey(); // => -KVr5eu8gcTv7_AHb-3-
$newPost->getUri(); // =>

$newPost->getChild('title')->set('Changed post title');
$newPost->getValue(); // Fetches the data from the realtime database