PHPackages                             kerox/fcm - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. kerox/fcm

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

kerox/fcm
=========

A PHP library to send push notification through Firebase Cloud Messaging

3.2.0(2y ago)181.0M↓19.3%6[1 issues](https://github.com/ker0x/fcm/issues)MITPHPPHP &gt;=8.2CI failing

Since Oct 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ker0x/fcm)[ Packagist](https://packagist.org/packages/kerox/fcm)[ Docs](https://github.com/ker0x/fcm)[ RSS](/packages/kerox-fcm/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (13)Versions (14)Used By (0)

[![Tests](https://camo.githubusercontent.com/4412c183af704e8751384a5e92b5589791de64689254a0911b981ec33c72ccd9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b657230782f66636d2f63692e796d6c3f6c6162656c3d7465737473267374796c653d666f722d7468652d6261646765)](https://github.com/ker0x/fcm/actions/workflows/ci.yml)[![Coverage](https://camo.githubusercontent.com/5c0a672fb92de227b495a775be7137f545bba3e0ce3565e89a4cdbffd2dde58e/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f6b657230782f66636d3f7374796c653d666f722d7468652d6261646765)](https://codecov.io/gh/ker0x/fcm/)[![PHP Version](https://camo.githubusercontent.com/78b497e96ab1d3fb0e52e74fd3ea30018f7e87b6818ed2dd1c324eab270f1476/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d382e322d3466356239332e7376673f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/78b497e96ab1d3fb0e52e74fd3ea30018f7e87b6818ed2dd1c324eab270f1476/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d382e322d3466356239332e7376673f7374796c653d666f722d7468652d6261646765)[![Download](https://camo.githubusercontent.com/eb20672eaa3911e7e17d608bc27431b98fad0d61d8b544ae987f2ff17d7d7907/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b65726f782f66636d2e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/kerox/fcm)[![Packagist](https://camo.githubusercontent.com/0a0c9f4762a04141acaf5ee97b136210a844cba18996f07794ca46795026711b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b65726f782f66636d2e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/kerox/fcm)[![License](https://camo.githubusercontent.com/852aa938213044320c442afb8220c11c93d658195cf6a8f961b9ebc51d877f06/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f74616c657366726f6d616465762f666c6f77626974652d62756e646c653f7374796c653d666f722d7468652d6261646765)](https://github.com/ker0x/fcm/blob/main/LICENSE)

Fcm
===

[](#fcm)

A PHP library to send push notification with [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/)

Note

Version `3.x` of this library is a full rewrite using [PSR-18 HTTP Client](https://www.php-fig.org/psr/psr-18/) interface, which means that **no** HTTP Client, like [Guzzle](https://github.com/guzzle/guzzle) or [httplug](https://github.com/php-http/httplug), are provided within. If you already have one in your project, the package will **automatically discover it** and use it. Otherwise You will need to require one separately.

Warning

Version `3.2` introduce a BC break. The signature of the `__construct()` method of the `Kerox\Fcm\Model\Message` class has changed, with the `$notification` parameter becoming the third argument and being optional.

Installation
------------

[](#installation)

You can install Fcm using Composer:

```
composer require kerox/fcm

```

You will then need to:

- run `composer install` to get these dependencies added to your vendor directory
- add the autoloader to your application with this line: `require('vendor/autoload.php');`

Basic usage
-----------

[](#basic-usage)

```
use Kerox\Fcm\Fcm;
use Kerox\Fcm\Model\Message;
use Kerox\Fcm\Model\Notification\Notification;
use Kerox\Fcm\Model\Target;

$fcm = new Fcm('', '');

// Create the message
$message = new Message(
    target: new Token('TopicA'),
    data: [
        'story_id' => 'story_12345',
    ],
    notification: new Notification(
        title: 'Hello World',
        body: 'My awesome Hello World!'
    ),
)

// Send the message and get the response
$response = $fcm->send()->message($message);
```

Documentation
-------------

[](#documentation)

The documentation is available [here](https://github.com/ker0x/fcm/wiki)

Testing
-------

[](#testing)

To live test the package, you must first generate an OAuth token. Go to  and select **Firebase Cloud Messaging API v1** from the list of APIs. Then select  and generate the OAuth token. Finally, define an environment variable named `FCM_OAUTH_TOKEN` and assign it the value of the access token.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community13

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 95.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 ~222 days

Recently: every ~68 days

Total

13

Last Release

870d ago

Major Versions

1.x-dev → 2.0.02018-09-25

2.x-dev → 3.0.02023-05-20

PHP version history (4 changes)1.0.0PHP &gt;=7.0

2.0.0PHP &gt;=7.1.0

2.3.0PHP &gt;=7.3.0

3.0.0PHP &gt;=8.2

### Community

Maintainers

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

---

Top Contributors

[![ker0x](https://avatars.githubusercontent.com/u/5331654?v=4)](https://github.com/ker0x "ker0x (42 commits)")[![demmmmios](https://avatars.githubusercontent.com/u/5690230?v=4)](https://github.com/demmmmios "demmmmios (1 commits)")[![tin-cat](https://avatars.githubusercontent.com/u/4244804?v=4)](https://github.com/tin-cat "tin-cat (1 commits)")

---

Tags

fcmfirebasefirebase-cloud-messagingmessagingnotificationsphpphp-libraypush-notificationspushnotificationFCMFirebase Cloud Messaging

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kerox-fcm/health.svg)

```
[![Health](https://phpackages.com/badges/kerox-fcm/health.svg)](https://phpackages.com/packages/kerox-fcm)
```

###  Alternatives

[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k28.0M318](/packages/openai-php-client)[sylius/sylius

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

8.5k5.9M738](/packages/sylius-sylius)[anthropic-ai/sdk

Anthropic PHP SDK

163583.3k17](/packages/anthropic-ai-sdk)[n1ebieski/ksef-php-client

PHP API client that allows you to interact with the API Krajowego Systemu e-Faktur

9067.8k](/packages/n1ebieski-ksef-php-client)[trycourier/courier

Courier PHP SDK

15660.9k](/packages/trycourier-courier)

PHPackages © 2026

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