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)15751.3k↓30.6%15[2 issues](https://github.com/valga/fbns-react/issues)19MITPHPPHP ^7.2 || ^8.0

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 1mo ago

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

49

—

FairBetter than 95% of packages

Maintenance44

Moderate activity, may be stable

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

403d 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

[react/http

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

78026.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)[warriorxk/phpwebsockets

A websocket library with support for IPC using socket pairs

1225.3k](/packages/warriorxk-phpwebsockets)

PHPackages © 2026

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