PHPackages                             lordgurke/php-matrix-sdk - 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. [API Development](/categories/api)
4. /
5. lordgurke/php-matrix-sdk

ActiveLibrary[API Development](/categories/api)

lordgurke/php-matrix-sdk
========================

PHP SDK for interacting with Matrix/Synapse.

0232↓91.7%PHP

Since Apr 11Pushed 3y agoCompare

[ Source](https://github.com/lordgurke/php-matrix-sdk)[ Packagist](https://packagist.org/packages/lordgurke/php-matrix-sdk)[ RSS](/packages/lordgurke-php-matrix-sdk/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (4)Used By (0)

Matrix client SDK for PHP
=========================

[](#matrix-client-sdk-for-php)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Software License](https://camo.githubusercontent.com/f1eb6135270a925b4590c14fc402a5fb7bd342135ecc7eaf0ce13c8ee252027f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6f72646775726b652f7068702d6d61747269782d73646b2e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/f1eb6135270a925b4590c14fc402a5fb7bd342135ecc7eaf0ce13c8ee252027f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6f72646775726b652f7068702d6d61747269782d73646b2e7376673f7374796c653d666c61742d737175617265)

This is a Matrix client-server SDK for php 7.4+, initially copied from [matrix-org/matrix-python-sdk](https://github.com/matrix-org/matrix-python-sdk), then forked by lordgurke to add imporvements and bugfixes.

This package is still a work in progress, and at the current time, not everything has been ported:

- Missing E2E encryption, need php bindings for the OLM library
- Live sync
- Unit tests for the client

Installation
------------

[](#installation)

Currently not public!

```
composer require lordgurke/php-matrix-sdk:master-dev

```

Usage
-----

[](#usage)

Client:

```
require('vendor/autoload.php');
use MatrixPhp\MatrixClient;

$client = new MatrixClient("http://localhost:8008");

// New user
$token = $client->registerWithPassword("foobar", "monkey");

// Existing user
$token = $client->login("foobar", "monkey");

$room = $client->createRoom("my_room_alias");
$room->sendText("Hello!");
```

API:

```
require('vendor/autoload.php');
use MatrixPhp\MatrixHttpApi;

$matrix = new MatrixHttpApi("http://localhost:8008", $sometoken);

$response = $matrix->sendMessage("!roomid:matrix.org", "Hello!");
```

Structure
---------

[](#structure)

The SDK is split into two modules: `api` and `client`.

### API

[](#api)

This contains the raw HTTP API calls and has minimal business logic. You can set the access token (`token`) to use for requests as well as set a custom transaction ID (`txn_id`) which will be incremented for each request.

### Client

[](#client)

This encapsulates the API module and provides object models such as `Room`.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email instead of using the issue tracker.

Credits
-------

[](#credits)

- [Brad Jones](https://github.com/bradjones1) at [Meet Kinksters](https://tech.kinksters.dating)
- [Yoann Celton](https://github.com/Aryess) (initial port)
- [All Contributors](https://github.com/meet-kinksters/php-matrix-sdk/graphs/contributors)

License
-------

[](#license)

[MIT License](LICENSE.md).

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor3

3 contributors hold 50%+ of commits

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/55060bb3dcdc7d501896833c120d30f9355f05304bb4f6bbab20693a0d5209b2?d=identicon)[lordgurke](/maintainers/lordgurke)

---

Top Contributors

[![philsturgeon](https://avatars.githubusercontent.com/u/67381?v=4)](https://github.com/philsturgeon "philsturgeon (49 commits)")[![frankdejonge](https://avatars.githubusercontent.com/u/534693?v=4)](https://github.com/frankdejonge "frankdejonge (38 commits)")[![bradjones1](https://avatars.githubusercontent.com/u/981966?v=4)](https://github.com/bradjones1 "bradjones1 (21 commits)")[![ravage84](https://avatars.githubusercontent.com/u/625761?v=4)](https://github.com/ravage84 "ravage84 (10 commits)")[![lordgurke](https://avatars.githubusercontent.com/u/25770486?v=4)](https://github.com/lordgurke "lordgurke (9 commits)")[![jotaelesalinas](https://avatars.githubusercontent.com/u/2042875?v=4)](https://github.com/jotaelesalinas "jotaelesalinas (8 commits)")[![hansott](https://avatars.githubusercontent.com/u/3886384?v=4)](https://github.com/hansott "hansott (7 commits)")[![RobLoach](https://avatars.githubusercontent.com/u/25086?v=4)](https://github.com/RobLoach "RobLoach (7 commits)")[![colinodell](https://avatars.githubusercontent.com/u/202034?v=4)](https://github.com/colinodell "colinodell (5 commits)")[![bcrowe](https://avatars.githubusercontent.com/u/752603?v=4)](https://github.com/bcrowe "bcrowe (5 commits)")[![reinink](https://avatars.githubusercontent.com/u/882133?v=4)](https://github.com/reinink "reinink (5 commits)")[![browner12](https://avatars.githubusercontent.com/u/5232313?v=4)](https://github.com/browner12 "browner12 (5 commits)")[![EmanueleMinotto](https://avatars.githubusercontent.com/u/417201?v=4)](https://github.com/EmanueleMinotto "EmanueleMinotto (5 commits)")[![gmponos](https://avatars.githubusercontent.com/u/5675248?v=4)](https://github.com/gmponos "gmponos (4 commits)")[![marcqualie](https://avatars.githubusercontent.com/u/101022?v=4)](https://github.com/marcqualie "marcqualie (4 commits)")[![hassankhan](https://avatars.githubusercontent.com/u/1781985?v=4)](https://github.com/hassankhan "hassankhan (3 commits)")[![jclyons52](https://avatars.githubusercontent.com/u/6395559?v=4)](https://github.com/jclyons52 "jclyons52 (3 commits)")[![vazaha-nl](https://avatars.githubusercontent.com/u/1075085?v=4)](https://github.com/vazaha-nl "vazaha-nl (2 commits)")[![assertchris](https://avatars.githubusercontent.com/u/200609?v=4)](https://github.com/assertchris "assertchris (2 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (2 commits)")

### Embed Badge

![Health badge](/badges/lordgurke-php-matrix-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/lordgurke-php-matrix-sdk/health.svg)](https://phpackages.com/packages/lordgurke-php-matrix-sdk)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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