lordgurke / php-matrix-sdk
PHP SDK for interacting with Matrix/Synapse.
Installs: 28
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 10
Open Issues: 0
pkg:composer/lordgurke/php-matrix-sdk
Requires
- php: ~7.4|^8
- ext-json: *
- guzzlehttp/guzzle: ^6.3|^7
- rappasoft/laravel-helpers: ^1.0
Requires (Dev)
- phpunit/phpunit: >=5.4.3
Replaces
- aryess/php-matrix-sdk: dev-master
- aryess/phpmatrixsdk: dev-master
- meet-kinksters/php-matrix-sdk: dev-master
This package is auto-updated.
Last update: 2025-10-12 04:17:45 UTC
README
This is a Matrix client-server SDK for php 7.4+, initially copied from 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
Currently not public!
composer require lordgurke/php-matrix-sdk:master-dev
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
The SDK is split into two modules: api and client.
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
This encapsulates the API module and provides object models such as Room.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email brad@kinksters.dating instead of using the issue tracker.
Credits
- Brad Jones at Meet Kinksters
- Yoann Celton (initial port)
- All Contributors