PHPackages                             simbiot1954/nats - 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. simbiot1954/nats

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

simbiot1954/nats
================

A nats.io client in PHP

0.8.7.2(8y ago)02.0kMITPHP

Since Jun 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/SimBioT1954/phpnats)[ Packagist](https://packagist.org/packages/simbiot1954/nats)[ RSS](/packages/simbiot1954-nats/feed)WikiDiscussions develop Synced today

READMEChangelogDependencies (1)Versions (37)Used By (0)

Introduction
------------

[](#introduction)

A PHP client for the [NATS messaging system](https://nats.io).

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

[](#requirements)

- php 7.1+
- [gnatsd](https://github.com/apcera/gnatsd)

### Basic Usage

[](#basic-usage)

```
$client = new \Nats\Connection();
$client->connect();

// Publish Subscribe

// Simple Subscriber.
$client->subscribe(
    'foo',
    function ($message) {
        printf("Data: %s\r\n", $message->getBody());
    }
);

// Simple Publisher.
$client->publish('foo', 'Marty McFly');

// Wait for 1 message.
$client->wait(1);

// Request Response

// Responding to requests.
$sid = $client->subscribe(
    'sayhello',
    function ($message) {
        $message->reply('Reply: Hello, '.$message->getBody().' !!!');
    }
);

// Request.
$client->request(
    'sayhello',
    'Marty McFly',
    function ($message) {
        echo $message->getBody();
    }
);
```

### Encoded Connections

[](#encoded-connections)

```
$encoder = new \Nats\Encoders\JSONEncoder();
$options = new \Nats\ConnectionOptions();
$client = new \Nats\EncodedConnection($options, $encoder);
$client->connect();

// Publish Subscribe

// Simple Subscriber.
$client->subscribe(
    'foo',
    function ($payload) {
        printf("Data: %s\r\n", $payload->getBody()[1]);
    }
);

// Simple Publisher.
$client->publish(
    'foo',
    [
     'Marty',
     'McFly',
    ]
);

// Wait for 1 message.
$client->wait(1);

// Request Response

// Responding to requests.
$sid = $client->subscribe(
    'sayhello',
    function ($message) {
        $message->reply('Reply: Hello, '.$message->getBody()[1].' !!!');
    }
);

// Request.
$client->request(
    'sayhello',
    [
     'Marty',
     'McFly',
    ],
    function ($message) {
        echo $message->getBody();
    }
);
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 80.6% 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 ~34 days

Recently: every ~71 days

Total

31

Last Release

2946d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/347d52ce50c74475f49f790f14f46b6586d07603e7c1ba5db0cdfcf27c8b98a3?d=identicon)[SimBioT](/maintainers/SimBioT)

---

Top Contributors

[![repejota](https://avatars.githubusercontent.com/u/36673?v=4)](https://github.com/repejota "repejota (261 commits)")[![dfeyer](https://avatars.githubusercontent.com/u/221173?v=4)](https://github.com/dfeyer "dfeyer (16 commits)")[![byrnedo](https://avatars.githubusercontent.com/u/5528491?v=4)](https://github.com/byrnedo "byrnedo (15 commits)")[![adriacidre](https://avatars.githubusercontent.com/u/593270?v=4)](https://github.com/adriacidre "adriacidre (12 commits)")[![octante](https://avatars.githubusercontent.com/u/1949683?v=4)](https://github.com/octante "octante (6 commits)")[![josgilmo](https://avatars.githubusercontent.com/u/773565?v=4)](https://github.com/josgilmo "josgilmo (4 commits)")[![gorkaio](https://avatars.githubusercontent.com/u/4482916?v=4)](https://github.com/gorkaio "gorkaio (2 commits)")[![SimBioT1954](https://avatars.githubusercontent.com/u/11522338?v=4)](https://github.com/SimBioT1954 "SimBioT1954 (1 commits)")[![xsuperbug](https://avatars.githubusercontent.com/u/7601737?v=4)](https://github.com/xsuperbug "xsuperbug (1 commits)")[![anthonysterling](https://avatars.githubusercontent.com/u/159960?v=4)](https://github.com/anthonysterling "anthonysterling (1 commits)")[![ipadavic](https://avatars.githubusercontent.com/u/2059817?v=4)](https://github.com/ipadavic "ipadavic (1 commits)")[![netroby](https://avatars.githubusercontent.com/u/154278046?v=4)](https://github.com/netroby "netroby (1 commits)")[![olivermack](https://avatars.githubusercontent.com/u/666035?v=4)](https://github.com/olivermack "olivermack (1 commits)")[![omack](https://avatars.githubusercontent.com/u/1389984?v=4)](https://github.com/omack "omack (1 commits)")[![sergeyklay](https://avatars.githubusercontent.com/u/1256298?v=4)](https://github.com/sergeyklay "sergeyklay (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/simbiot1954-nats/health.svg)

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

###  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)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

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

78126.4M414](/packages/react-http)

PHPackages © 2026

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