PHPackages                             mjcodebase/fbns-react - 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. mjcodebase/fbns-react

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

mjcodebase/fbns-react
=====================

A PHP client for the FBNS built on top of ReactPHP

1.7(7mo ago)09651MITPHPPHP ^7.2|^8.0

Since Feb 20Pushed 7mo agoCompare

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

READMEChangelog (8)Dependencies (11)Versions (8)Used By (0)

fbns-react
==========

[](#fbns-react)

A PHP client for the FBNS, built on top of ReactPHP. Includes generic RTI client implementation.

Requirements
------------

[](#requirements)

You have to install the [GMP extension](http://php.net/manual/en/book.gmp.php) to be able to run this code on x86 PHP builds.

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

[](#installation)

```
composer require valga/fbns-react
```

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

[](#basic-usage)

```
// Set up a Push client.
$loop = \React\EventLoop\Factory::create();
$auth = new \Fbns\Auth\DeviceAuth();
$device = new \Fbns\Device\DefaultDevice(USER_AGENT);
$network = new \Fbns\Network\Wifi();
$client = new \Fbns\Client($loop, $auth, $device, $network, $logger);

// Read saved credentials from the storage.
try {
    $auth->read($storage->get('fbns_auth'));
} catch (\Throwable $e) {
}

// Bind events.
$client
    ->on('connect', static function (string $jsonAuth) use ($client, $auth, $storage, $app) {
        // Update credentials and save them to the storage for future use.
        try {
            $auth->read($jsonAuth);
            $storage->set('fbns_auth', json_encode($auth));
        } catch (\Throwable $e) {
        }

        // Register the application.
        $client->register(PACKAGE_NAME, APPLICATION_ID)
            ->then(static function (\Fbns\Push\Registration $registration) use ($app) {
                $app->registerPushToken($registration->getToken());
            });
    })
    ->on('push', static function (\Fbns\Push\Notification $message) use ($app) {
        // Handle received notification payload.
        $app->handlePushNotification($message->getPayload());
    });

// Connect to the broker.
$client->connect(HOSTNAME, PORT);

// Run main loop.
$loop->run();
```

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

[](#advanced-usage)

```
// Set up a proxy.
$connector = new \React\Socket\Connector($loop);
$proxy = new \Clue\React\HttpProxy('username:password@127.0.0.1:3128', $connector);

// Disable SSL verification.
$ssl = new \React\Socket\SecureConnector($proxy, $loop, ['verify_peer' => false, 'verify_peer_name' => false]);

// Enable logging to stdout.
$logger = new \Monolog\Logger('push');
$logger->pushHandler(new \Monolog\Handler\StreamHandler('php://stdout', \Monolog\Logger::INFO));

// Set up a Push client.
$client = new \Fbns\Client($loop, $auth, $device, $network, $logger, $connector);

// Persistence.
$client->on('disconnect', static function () {
    // Network connection has been closed. You can reestablish it if you want to.
});
$client->connect(HOSTNAME, PORT)
    ->otherwise(static function () {
        // Connection attempt was unsuccessful, retry with an exponential backoff.
    });
```

###  Health Score

40

—

FairBetter than 87% of packages

Maintenance69

Regular maintenance activity

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.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 ~160 days

Recently: every ~240 days

Total

7

Last Release

214d ago

PHP version history (2 changes)1.0PHP ^5.6|^7.0|^8.0

1.5PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dcf1f9f8ae04d6ea6d41002f8cb2e0cc47d44a8c6b8b6171f2ee53ff9d21bf7?d=identicon)[mjohnsoncode](/maintainers/mjohnsoncode)

---

Top Contributors

[![sergeykomlev](https://avatars.githubusercontent.com/u/40078038?v=4)](https://github.com/sergeykomlev "sergeykomlev (40 commits)")[![mjohnsoncode](https://avatars.githubusercontent.com/u/159731452?v=4)](https://github.com/mjohnsoncode "mjohnsoncode (5 commits)")

---

Tags

phpclientFBNS

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/mjcodebase-fbns-react/health.svg)

```
[![Health](https://phpackages.com/badges/mjcodebase-fbns-react/health.svg)](https://phpackages.com/packages/mjcodebase-fbns-react)
```

###  Alternatives

[valga/fbns-react

A PHP client for the FBNS built on top of ReactPHP

15751.3k19](/packages/valga-fbns-react)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)[binsoul/net-mqtt-client-react

Asynchronous MQTT client built on React

48787.8k24](/packages/binsoul-net-mqtt-client-react)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[simpod/clickhouse-client

PHP ClickHouse Client

19116.7k](/packages/simpod-clickhouse-client)[wormling/phparia

Asterisk REST Interface (ARI) client for PHP.

419.8k](/packages/wormling-phparia)

PHPackages © 2026

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