PHPackages                             xmpp-fg/xmpp-fg - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. xmpp-fg/xmpp-fg

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xmpp-fg/xmpp-fg
===============

XMPP client library

v0.9.0(2mo ago)16BSD-2-ClausePHPPHP ^8.3

Since May 20Pushed 2mo agoCompare

[ Source](https://github.com/mdissington/xmpp-fg)[ Packagist](https://packagist.org/packages/xmpp-fg/xmpp-fg)[ Docs](https://github.com/mdissington/xmpp-fg)[ RSS](/packages/xmpp-fg-xmpp-fg/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

Library for XMPP protocol connections (Jabber) for PHP.

SYSTEM REQUIREMENTS
-------------------

[](#system-requirements)

- PHP &gt;= 8.3
- psr/log
- (optional) psr/log-implementation - like monolog/monolog for logging

INSTALLATION
------------

[](#installation)

Install [Composer](https://getcomposer.org/download/) and then

```
composer require xmpp-fg/xmpp-fg
```

DOCUMENTATION
-------------

[](#documentation)

You can check `example.php` for auto reply bot example

This library uses an object to hold options:

```
use Fabiang\Xmpp\Options;
$options = new Options($address);
$options->setUsername($username)
    ->setPassword($password);
```

The server address must be in the format `myjabber.com:5222`. If the server supports TLS the connection will automatically be encrypted.

If you want to use SOCKS proxy you can set it by

```
$options->setSocksProxyAddress('localhost:9050');
```

or

```
$options->setSocksProxyAddress('username:password@localhost:9050');
```

You can also pass a PSR-3 compatible object to the options object:

```
$options->setLogger($logger);
```

The client manages the connection to the Jabber server and requires the options object:

```
use Fabiang\Xmpp\Client;
$client = new Client($options);
// optional connect manually
$client->connect();
```

You can use `getMessages()` for get all incoming messages

```
print_r($client->getMessages());
```

```
Array
(
    [0] => Array
        (
            [from] => user@myjabber.com/resource
            [message] => Message text
        )

)

```

For sending data you just need to pass a object that implements `Fabiang\Xmpp\Protocol\ProtocolImplementationInterface`:

```
use Fabiang\Xmpp\Protocol\Roster;
use Fabiang\Xmpp\Protocol\Presence;
use Fabiang\Xmpp\Protocol\Message;

// fetch roster list; users and their groups
$client->send(new Roster);
// set status to online
$client->send(new Presence);

// send a message to another user
$message = new Message;
$message->setMessage('test')
    ->setTo('nickname@myjabber.com');
$client->send($message);

// join a channel
$channel = new Presence;
$channel->setTo('channelname@conference.myjabber.com/nickname')
    ->setPassword('channelpassword');
$client->send($channel);

// send a message to the above channel
$message = new Message;
$message->setMessage('test')
    ->setTo('channelname@conference.myjabber.com')
    ->setType(Message::TYPE_GROUPCHAT);
$client->send($message);
```

After all you should disconnect:

```
$client->disconnect();
```

DEVELOPING
----------

[](#developing)

If you like this library and you want to contribute, make sure the unit-tests and integration tests are running. Composer will help you to install the right version of PHPUnit.

```
composer install

```

Test with:

```
composer test

```

Run code analysis with:

```
composer analyse

```

You can run both together using:

```
composer test-and-analyse

```

New features should always developed using TDD with PHPUnit.

LICENSE
-------

[](#license)

BSD-2-Clause. See the [LICENSE](LICENSE.md).

TODO
----

[](#todo)

- improve documentation

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance87

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

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

Unknown

Total

1

Last Release

65d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b2039c6fd0c56d2e3b672e3c3de49fa94c13f06e743973ed530edcc19f318aa?d=identicon)[mdissington](/maintainers/mdissington)

---

Top Contributors

[![fabiang](https://avatars.githubusercontent.com/u/348344?v=4)](https://github.com/fabiang "fabiang (153 commits)")[![mdissington](https://avatars.githubusercontent.com/u/56117154?v=4)](https://github.com/mdissington "mdissington (24 commits)")[![zorn-v](https://avatars.githubusercontent.com/u/12619075?v=4)](https://github.com/zorn-v "zorn-v (15 commits)")[![n10ty](https://avatars.githubusercontent.com/u/2970001?v=4)](https://github.com/n10ty "n10ty (2 commits)")[![alexalouit](https://avatars.githubusercontent.com/u/1419377?v=4)](https://github.com/alexalouit "alexalouit (1 commits)")[![marclaporte](https://avatars.githubusercontent.com/u/1004261?v=4)](https://github.com/marclaporte "marclaporte (1 commits)")[![pirxthepilot](https://avatars.githubusercontent.com/u/7690118?v=4)](https://github.com/pirxthepilot "pirxthepilot (1 commits)")[![iivannov](https://avatars.githubusercontent.com/u/7932620?v=4)](https://github.com/iivannov "iivannov (1 commits)")[![antonkomarev](https://avatars.githubusercontent.com/u/1849174?v=4)](https://github.com/antonkomarev "antonkomarev (1 commits)")[![frederikbosch](https://avatars.githubusercontent.com/u/1552577?v=4)](https://github.com/frederikbosch "frederikbosch (1 commits)")[![Ghitu](https://avatars.githubusercontent.com/u/7511010?v=4)](https://github.com/Ghitu "Ghitu (1 commits)")

---

Tags

xmppjabber

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/xmpp-fg-xmpp-fg/health.svg)

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

###  Alternatives

[symfony/lock

Creates and manages locks, a mechanism to provide exclusive access to a shared resource

515139.2M711](/packages/symfony-lock)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k54](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k46](/packages/civicrm-civicrm-core)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M221](/packages/illuminate-broadcasting)[logiscape/mcp-sdk-php

Model Context Protocol SDK for PHP

367116.8k12](/packages/logiscape-mcp-sdk-php)

PHPackages © 2026

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