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

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

miljan/fbns-react
=================

A PHP client for the FBNS built on top of ReactPHP

0417PHP

Since Jun 7Pushed 2y agoCompare

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

READMEChangelogDependenciesVersions (1)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

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 93% 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.

### Community

Maintainers

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

---

Top Contributors

[![valga](https://avatars.githubusercontent.com/u/23472603?v=4)](https://github.com/valga "valga (53 commits)")[![Miljan9602](https://avatars.githubusercontent.com/u/19391119?v=4)](https://github.com/Miljan9602 "Miljan9602 (2 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)")

### Embed Badge

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

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

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

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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