mtcute/packages/client
2023-11-12 01:17:20 +03:00
..
scripts fix: migrated to web streams 2023-10-20 00:41:47 +03:00
src chore: removed dispatcher dep from core (again), improved build script 2023-11-12 01:17:20 +03:00
build.config.cjs build: extracted custom build config to packages themselves 2023-11-02 21:23:17 +03:00
package.json test: moved to vitest from mocha/chai 2023-11-09 00:20:43 +03:00
README.md docs: updated packages readmes 2023-11-01 14:05:45 +03:00
tsconfig.json ESM + end-to-end tests (#11) 2023-10-16 19:23:53 +03:00
typedoc.cjs fix: improved surface api 2023-10-29 00:48:37 +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