taknone/sessionbridge

Migrate your Telegram session safely between libraries

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 0

Forks: 0

Open Issues: 0

Type:project

pkg:composer/taknone/sessionbridge

v1.0.1 2025-11-05 10:05 UTC

This package is auto-updated.

Last update: 2025-11-05 16:25:05 UTC


README

logo SessionBridge : Pure-PHP library to convert and bridge Telegram sessions between popular client formats ( Telethon , Pyrogram , Tdata , MadelineProto ) and LiveProto ( LP )

🔥 SessionBridge focuses on compatibility, reliability, and realistic production use. It provides a unified API and CLI to read, validate, convert, and export session / auth data across different implementations of Telegram's MTProto ecosystem

Key features

  • Convert sessions between Telethon , Pyrogram , MadelineProto , Tdata ( Telegram Desktop ) and LiveProto ( LP ) formats
  • High-fidelity mapping of session fields where possible ( dc_id , ip , port , auth_key )
  • Simple, chainable PHP API and a practical command-line interface ( CLI )

Note : SessionBridge is a translator / bridge between session file formats ( or text of session ) it does not reimplement MTProto or perform network login for you. Use a proper client library ( MadelineProto , LiveProto , Telethon , Pyrogram ) to perform active logins and connection flows

Installation

Install via Composer :

composer require taknone/sessionbridge

Or include directly in your project autoload

Quick start

PHP

<?php

require_once 'vendor/autoload.php';

use function Tak\SessionBridge\from_madelineproto_string;

use function Tak\SessionBridge\to_liveproto_sqlite;

$sessions = from_madelineproto_string('session.madeline');

foreach($sessions as $session){
	var_dump(to_liveproto_sqlite($session));
}

?>

CLI

  • convert telethon.session file to LiveProto file
php vendor/bin/sessionbridge --from telethon-sqlite --to liveproto-sqlite --session telethon.session

Supported formats

  • Telethon ( .session SQLite / String )
  • Pyrogram ( .session SQLite / String )
  • MadelineProto ( PHP session arrays / serialized files )
  • Tdata ( Telegram Desktop profile folder , extract relevant files )
  • LiveProto ( LP ) ( first-class citizen , SessionBridge is linked and can export / import LP files )

If you need support for additional session types open an issue or contribute an adapter

Type From To
LiveProto String
LiveProto SQLite
Telethon String
Telethon SQLite
Pyrogram String
Pyrogram SQLite
Madeline String
Tdata

License

SessionBridge is released under the AGPLv3

Contact

If you need help, open an issue or discuss changes via pull requests. For sensitive security issues, use the repository's security contact

🎊 Happy bridging !