Skip to Content
ReferenceNodeOverview

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 pointModuleHolds
opentele2CommonJS, index.js / index.d.tsThe core: tdata, sessions, profiles, checks, crypto, browser fingerprints, versions
opentele2/mtcuteES module, mtcute.mjs / mtcute.d.tsmtcute string sessions, initConnectionOptions, the crypto provider and the client flows
opentele2/telethonES module, telethon.mjs / telethon.d.tsTelethon .session files and .session + .json pairs

opentele2 by area

Subpaths

Conventions

  • User ids, takeout ids and SRP ids are bigint; auth keys and other bytes are Buffer on output and Uint8Array on input.
  • Functions that touch the disk, derive keys or draw fingerprints return a Promise; the rest are synchronous.
  • Failures throw or reject with an Error whose code names the failure; see Errors.
  • __napiBindingTarget tells which artifact the loader loaded: 'native', 'wasm32-wasi' or 'wasm32-wasip1'.
Last updated on