Node reference
The npm package opentele2 (Node 18+) is a native addon built from the Rust core with napi-rs,
plus two ES module subpaths.
npm install opentele2| Entry point | Module | Holds |
|---|---|---|
opentele2 | CommonJS, index.js / index.d.ts | The core: tdata, sessions, profiles, checks, crypto, browser fingerprints, versions |
opentele2/mtcute | ES module, mtcute.mjs / mtcute.d.ts | mtcute string sessions, initConnectionOptions, the crypto provider and the client flows |
opentele2/telethon | ES module, telethon.mjs / telethon.d.ts | Telethon .session files and .session + .json pairs |
opentele2 by area
loadTdata, newTdata, saveTdata, TData, accounts and the MTP config.
String sessions, .session rows and files, the .json companion.
profile, generate, the session JSON profile and the device catalogs.
validateInitParams, fingerprintConfig, tzOffset, the layer and msg ids.
The seven checks, session rows and tables, QR login URLs, SRP and the flow messages.
AES-IGE and -CTR, SHA, HMAC, PBKDF2, local keys, Argon2id, PQ, gzip and random bytes.
generateHeaders and generateFingerprint with their option and result types.
fetchVersions, platformVersions, applyVersionsPatch and the version types.
OT_ codes, legacyMessage and ERR_INVALID_ARG_VALUE.
Subpaths
Conventions
- User ids, takeout ids and SRP ids are
bigint; auth keys and other bytes areBufferon output andUint8Arrayon input. - Functions that touch the disk, derive keys or draw fingerprints return a
Promise; the rest are synchronous. - Failures throw or reject with an
Errorwhosecodenames the failure; see Errors. __napiBindingTargettells which artifact the loader loaded:'native','wasm32-wasi'or'wasm32-wasip1'.