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

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

valga/fbns-react
================

A PHP client for the FBNS built on top of ReactPHP

0.3.2(1y ago)15754.6k↓41.1%15[3 issues](https://github.com/valga/fbns-react/issues)19MITPHPPHP ^7.2 || ^8.0CI failing

Since Aug 6Pushed 1y ago3 watchersCompare

[ Source](https://github.com/valga/fbns-react)[ Packagist](https://packagist.org/packages/valga/fbns-react)[ RSS](/packages/valga-fbns-react/feed)WikiDiscussions master Synced yesterday

READMEChangelog (7)Dependencies (11)Versions (21)Used By (19)

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

48

—

FairBetter than 93% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity46

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 96.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 ~147 days

Recently: every ~435 days

Total

20

Last Release

449d ago

PHP version history (3 changes)0.1.0PHP ~5.6|~7.0

0.2.0PHP ^7.2

0.3.2PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/26eed1a8ba782687f197fcbc91496308a77d0ace6eee6ef368c8df881dc60b97?d=identicon)[valga](/maintainers/valga)

---

Top Contributors

[![valga](https://avatars.githubusercontent.com/u/23472603?v=4)](https://github.com/valga "valga (55 commits)")[![mgp25](https://avatars.githubusercontent.com/u/5390120?v=4)](https://github.com/mgp25 "mgp25 (1 commits)")[![nemanjan00](https://avatars.githubusercontent.com/u/448151?v=4)](https://github.com/nemanjan00 "nemanjan00 (1 commits)")

---

Tags

clientfbnsphpphpclientFBNS

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

43.2k341.0k1](/packages/ccxt-ccxt)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[api-platform/metadata

API Resource-oriented metadata attributes and factories

275.0M219](/packages/api-platform-metadata)[binsoul/net-mqtt-client-react

Asynchronous MQTT client built on React

51794.0k24](/packages/binsoul-net-mqtt-client-react)

PHPackages © 2026

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