PHPackages                             protobrick/mtproto-client - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. protobrick/mtproto-client

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

protobrick/mtproto-client
=========================

Modern async pure PHP client library for Telegram MTProto API

v0.1.1-beta(3mo ago)1113MITPHP

Since Jan 16Pushed 3mo agoCompare

[ Source](https://github.com/Proto-Brick/php-mtproto-client)[ Packagist](https://packagist.org/packages/protobrick/mtproto-client)[ Docs](https://github.com/Proto-Brick/php-mtproto-client)[ RSS](/packages/protobrick-mtproto-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (9)Versions (3)Used By (0)

 [![Proto Brick](https://raw.githubusercontent.com/Proto-Brick/php-mtproto-client/master/.github/img/logo.jpg)](https://raw.githubusercontent.com/Proto-Brick/php-mtproto-client/master/.github/img/logo.jpg)

[![Latest Stable Version](https://camo.githubusercontent.com/91cbf4cde99ad720f57599874d975408d5d18d95338da08d940de9e85a981511/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70726f746f627269636b2f6d7470726f746f2d636c69656e743f7374796c653d666c61742d737175617265)](https://packagist.org/packages/protobrick/mtproto-client)[![PHP Version](https://camo.githubusercontent.com/f0533b87f6e7eae12894a28e0d689d3ea5480ff1e99f400531fc43309d7a8200/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d3737376262343f7374796c653d666c61742d737175617265)](https://php.net/)[![API Layer](https://camo.githubusercontent.com/2092fcf406b593d8aacedf3d981a5aebfa3e46d673717958c46ec59d67caf3ed/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4150492532304c617965722d3232302d626c756576696f6c65743f7374796c653d666c61742d737175617265)](https://core.telegram.org/schema)[![License](https://camo.githubusercontent.com/422db9fd40f5831c765cf6530b6750c081b696bd18d904cf89554df98c676277/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e3f7374796c653d666c61742d737175617265)](./LICENSE)[![Telegram Chat](https://camo.githubusercontent.com/527eb21d43ee4f6141124c223bf5188f9eead28fa90d45999617aaf55e15f2b2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d54656c656772616d5f436861742d3236413545343f7374796c653d666c61742d737175617265266c6f676f3d74656c656772616d266c6f676f436f6c6f723d7768697465)](https://t.me/ProtoBrickChat)

> **Proto Brick is just starting its journey. Your stars ⭐️ are crucial for the project's visibility!**

Proto Brick
===========

[](#proto-brick)

 **Modern async pure PHP client library for Telegram MTProto. Build userbots with direct API access — no TDLib dependencies.**

Note

🚧 **Work in Progress:** This library is currently under active development. Features are being added rapidly, and breaking changes may occur before the v1.0 release.

🚀Features
---------

[](#features)

- **Full Async:** Built on top of [AMPHP](https://amphp.org/) and [Revolt](https://revolt.run/) for high-performance non-blocking I/O.
- **Pure PHP Implementation:** No requirement for the official `tdlib` binary extension. Works anywhere PHP runs.
- **Strictly Typed:** 100% of the API is auto-generated from the official [TL-Schema](https://core.telegram.org/schema).
- **Direct API Access:** 1:1 mapping of Telegram API methods (e.g., `$client->messages->sendMessage`).
- **Smart Peer Management:** Automatically handles `access_hash` and resolves `@usernames` or `IDs` via local cache.
- **Advanced Logging:** Native colorized console output with channel filtering, fully compatible with PSR-3

📋Requirements
-------------

[](#requirements)

- PHP 8.2+ (64-bit)
- Required Extensions: `ext-zlib`, `ext-json`
- **Highly Recommended Extensions:**
    - `ext-gmp` (Speeds up crypto/auth operations).
    - `ext-openssl` (Speeds up crypto operations).
    - `ext-uv` (Better event loop performance).

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

[](#installation)

```
composer require "protobrick/mtproto-client:^0.1-beta"
```

Authentication
--------------

[](#authentication)

### Interactive Login (CLI)

[](#interactive-login-cli)

Run **once** to log in. It prompts for credentials (phone, code, 2FA) and saves the session locally.

```
