mtcute/packages/client
2023-12-23 02:18:32 +03:00
..
scripts refactor(client)!: extracted inline callback query into a separate update 2023-12-14 00:34:51 +03:00
src chore(client): explicitly separate auth state init and get 2023-12-23 02:18:32 +03:00
build.config.cjs fix(client): fixed typings 2023-12-04 15:08:05 +03:00
package.json v0.3.0 2023-12-18 11:51:40 +00:00
README.md docs: updated packages readmes 2023-11-01 14:05:45 +03:00
tsconfig.json test(client): test coverage for client utils 2023-11-16 02:42:02 +03:00
typedoc.cjs chore: moved most configs to .config 2023-11-13 13:28:11 +03:00
utils.ts ESM + end-to-end tests (#11) 2023-10-16 19:23:53 +03:00

@mtcute/client

📖 API Reference

High-level Telegram client implementation over the @mtcute/core base library.

Features

  • Updates handling: Implements proper updates handling, including ordering and gap recovery (learn more)
  • Wrapper classes: Easy-to-use classes that wrap the complex TL objects and provide a clean interface
  • High-level methods: Methods that wrap the low-level API calls and provide a clean interface
  • Tree-shaking: Only import the methods you need, and the rest will not be included into the bundle
  • Web support: Works in the browser with no additional configuration

Usage

import { TelegramClient } from '@mtcute/client'

const tg = new TelegramClient({
    apiId: 12345,
    apiHash: '0123456789abcdef0123456789abcdef',
    // ... + supports all options from @mtcute/core ...
})

tg.start({
    phone: '+1234567890',
    password: () => prompt('Enter password'),
    code: () => prompt('Enter code'),
}, (user) => {
    console.log(`Logged in as ${user.displayName}`)
})

Note

as it is tree-shakeable learn more