# @mtcute/core

> Type-safe library for MTProto (Telegram API)

Latest version **0.32.3** (published 2026-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mtcute/core
pnpm add @mtcute/core
yarn add @mtcute/core
bun add @mtcute/core
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; large bundle; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.32.3 |
| Published | 2026-09-25 |
| First published | 2023-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 7 |
| Unpacked size | 14.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 568 |
| Author | alina sireneva |
| Maintainers | teidesu |

## Links

- npm: https://www.npmjs.com/package/@mtcute/core
- Repository: https://github.com/mtcute/mtcute
- Homepage: https://mtcute.dev
- Issues: https://github.com/mtcute/mtcute/issues
- npm.io page: https://npm.io/package/@mtcute/core

## Dependencies (7)

- [long](https://npm.io/package/long.md) ^5.3.2
- [@fuman/io](https://npm.io/package/@fuman/io.md) 0.0.21
- [@fuman/net](https://npm.io/package/@fuman/net.md) 0.0.21
- [@fuman/utils](https://npm.io/package/@fuman/utils.md) 0.0.21
- [@types/events](https://npm.io/package/@types/events.md) 3.0.0
- [@mtcute/file-id](https://npm.io/package/@mtcute/file-id.md) ^0.32.0
- [@mtcute/tl-runtime](https://npm.io/package/@mtcute/tl-runtime.md) ^0.32.0

## Recent versions

- 0.32.3 (latest) — 2026-09-25
- 0.32.2 — 2026-09-19
- 0.32.1 — 2026-08-30
- 0.32.0 — 2026-08-27
- 0.31.0 — 2026-07-15
- 0.30.3 — 2026-07-03
- 0.30.2 — 2026-07-02
- 0.30.1 — 2026-06-13
- 0.30.0 — 2026-06-09
- 0.29.7 — 2026-05-08
- 0.29.6 — 2026-04-08
- 0.29.5 — 2026-04-02
- 0.29.4 — 2026-03-23
- 0.29.1 — 2026-03-21
- 0.29.0 — 2026-03-16
- … 102 more at https://npm.io/package/@mtcute/core/versions

## README

# @mtcute/core

📖 [API Reference](https://ref.mtcute.dev/modules/_mtcute_core.html)

Platform-agnostic MTProto implementation and auxiliary utilities.

## Features
- **MTProto 2.0**: Implements the full MTProto protocol, including all the encryption and serialization
- **2FA support**: Provides utilities for 2-step verification
- **Hackable**: Bring your own storage, transport, and other components to customize the library to your needs
- **Magical**: Handles reconnections, connection pooling, DC redirections and other stuff for you
- **Updates handling**: Implements proper updates handling, including ordering and gap recovery (learn more)
- **High-level**: Includes a high-level API that wrap the MTProto APIs and provide a clean interface
- **Tree-shaking**: You can import just the methods you need, and the rest will not be included into the bundle

## Usage

```ts
import { BaseTelegramClient } from '@mtcute/core/client.js'

const tg = new BaseTelegramClient({
    apiId: 12345,
    apiHash: '0123456789abcdef0123456789abcdef',
    crypto: new MyCryptoProvider(),
    storage: new MyStorage(),
    transport: () => new MyTransport(),
})

tg.call({ _: 'help.getConfig' })
    .then(console.log)
```

## Usage with high-level API

```ts
import { TelegramClient } from '@mtcute/core/client.js'

const tg = new TelegramClient({
    // ... same options as above
})

const self = await tg.start({
    phone: '+1234567890',
    code: () => prompt('Enter the code:'),
    password: 'my-password',
})
console.log(`✨ logged in as ${self.displayName}`)
```

---
_Source: https://npm.io/package/@mtcute/core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
