A Flutter plugin that wraps the official Telegram Login SDK and exposes a Dart API for signing users in with their Telegram account.
| Package | Pub |
|---|---|
| telegram_login | pub package |
- Native OAuth flow powered by the official Telegram SDKs
- iOS: Universal Links (iOS 17.4+) and Custom URL Schemes (fallback)
- Android: App Links support
- Automatic URL callback forwarding — no
AppDelegate/Activitywiring required cancelLogin()for user-driven cancellation; late native callbacks are discarded
import 'package:telegram_login/telegram_login.dart';
final telegramLogin = TelegramLogin();
await telegramLogin.configure(
const TelegramLoginConfiguration(
clientId: 'YOUR_BOT_CLIENT_ID',
redirectUri: 'https://app12345-login.tg.dev',
scopes: ['profile'],
),
);
try {
final result = await telegramLogin.login();
print('ID Token: ${result.idToken}');
// Send result.idToken to your backend for verification.
} on TelegramLoginError catch (e) {
print('Login failed: ${e.code.name} — ${e.message}');
}- Package README - Detailed API documentation
- Example - Runnable example app
We welcome contributions! Please read our Contributing Guide for details on how to get started.
This project is licensed under the MIT License - see the LICENSE file for details.