kreait / firebase-php
Firebase Admin SDK
Fund package maintenance!
jeromegamez
Installs: 32 855 076
Dependents: 87
Suggesters: 2
Security: 1
Stars: 2 378
Watchers: 33
Forks: 450
Open Issues: 17
Requires
- php: ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0
- ext-ctype: *
- ext-filter: *
- ext-json: *
- ext-mbstring: *
- beste/clock: ^3.0
- beste/in-memory-cache: ^1.3.1
- beste/json: ^1.5.1
- cuyz/valinor: ^2.0
- fig/http-message-util: ^1.1.5
- firebase/php-jwt: ^6.10.2
- google/auth: ^v1.45
- google/cloud-storage: ^1.45
- guzzlehttp/guzzle: ^7.9.2
- guzzlehttp/promises: ^2.0.4
- guzzlehttp/psr7: ^2.7
- kreait/firebase-tokens: ^5.2
- lcobucci/jwt: ^4.3|^5.3
- mtdowling/jmespath.php: ^2.8.0
- psr/cache: ^1.0.1|^2.0|^3.0
- psr/clock: ^1.0
- psr/http-client: ^1.0.3
- psr/http-factory: ^1.1
- psr/http-message: ^1.1 || ^2.0
- psr/log: ^1.1|^2.0|^3.0.2
Requires (Dev)
- google/cloud-firestore: ^1.53.0
- php-cs-fixer/shim: ^3.85.1
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan: ^2.1.22
- phpstan/phpstan-deprecation-rules: ^2.0.3
- phpstan/phpstan-phpunit: ^2.0.7
- phpstan/phpstan-strict-rules: ^2.0.6
- phpunit/phpunit: ^10.5.48
- rector/rector: ^2.1.2
- shipmonk/composer-dependency-analyser: ^1.8.3
- symfony/var-dumper: ^6.4.15 || ^7.3.2
- vlucas/phpdotenv: ^5.6.2
Suggests
- google/cloud-firestore: ^1.0 to use the Firestore component
- 7.x-dev
- 7.22.0
- 7.21.2
- 7.21.1
- 7.21.0
- 7.20.0
- 7.19.0
- 7.18.0
- 7.17.0
- 7.16.1
- 7.16.0
- 7.15.0
- 7.14.0
- 7.13.1
- 7.13.0
- 7.12.0
- 7.11.0
- 7.10.0
- 7.9.1
- 7.9.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0
- 4.11.0
- 4.10.1
- 4.10.0
- 4.9.0
- 4.8.0
- 4.7.1
- 4.7.0
- 4.6.0
- 4.5.0
- 4.4.0
- 4.3.0
- 4.2.3
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.2
- 4.0.1
- 4.0.0
- 3.9.3
- 3.9.2
- 3.9.1
- 3.9.0
- 3.8.2
- 3.8.1
- 3.8.0
- 3.7.1
- 3.7.0
- 3.6.0
- 3.5.0
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.1
- 3.2.0
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.2
- 3.0.1
- 3.0.0
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.2
- 2.0.1
- 2.0.0
- 2.0.0-beta3
- 2.0.0-beta2
- 2.0.0-beta1
- 1.2.2
- 1.2.1
- 1.2
- 1.1.1
- 1.1
- 1.0.1
- 1.0
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.1
- 0.9
- 0.8
- 0.7
- 0.6.2
- 0.6.1
- 0.6
- 0.5
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.1
- 0.3
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2
- 0.1.1
- 0.1
- dev-dependabot/github_actions/actions/cache-4.3.0
- dev-custom-service-account-id-for-token-generation
This package is auto-updated.
Last update: 2025-09-25 00:08:38 UTC
README
Firebase for PHP
Firebase Admin SDK for PHP
Important
Support the project: This SDK is downloaded 1M+ times monthly and powers thousands of applications. If it saves you or your team time, please consider sponsoring its development.
Note
If you are interested in using the PHP Admin SDK as a client for end-user access (for example, in a web application), as opposed to admin access from a privileged environment (like a server), you should instead follow the instructions for setting up the client JavaScript SDK.
Overview
Firebase provides the tools and infrastructure you need to develop your app, grow your user base, and earn money. The Firebase Admin PHP SDK enables access to Firebase services from privileged environments (such as servers or cloud) in PHP.
For more information, visit the Firebase Admin PHP SDK documentation.
Installation
The recommended way to install the Firebase Admin SDK is with Composer. Composer is a dependency management tool for PHP that allows you to declare the dependencies your project needs and installs them into your project.
composer require "kreait/firebase-php:^7.0"
Please continue to the Setup section to learn more about connecting your application to Firebase.
If you want to use the SDK within a Framework, please follow the installation instructions here:
- Laravel: https://github.com/kreait/laravel-firebase
- Symfony: https://github.com/kreait/firebase-bundle
Quickstart
use Kreait\Firebase\Factory; $factory = (new Factory) ->withServiceAccount('/path/to/firebase_credentials.json') ->withDatabaseUri('https://my-project-default-rtdb.firebaseio.com'); $auth = $factory->createAuth(); $realtimeDatabase = $factory->createDatabase(); $cloudMessaging = $factory->createMessaging(); $remoteConfig = $factory->createRemoteConfig(); $cloudStorage = $factory->createStorage(); $firestore = $factory->createFirestore();
License
Firebase Admin PHP SDK is licensed under the MIT License.
Your use of Firebase is governed by the Terms of Service for Firebase Services.