Socket
Socket
Sign inDemoInstall

@mtcute/client

Package Overview
Dependencies
8
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @mtcute/client

High-level API over @mtcute/core


Version published
Maintainers
1
Created

Readme

Source

@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: for web, prefer BaseTelegramClient over TelegramClient, as it is tree-shakeable – learn more

FAQs

Last updated on 29 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc