📖 API Reference
Platform-agnostic MTProto implementation and auxiliary utilities.
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)
import { TelegramClient } from '@mtcute/core/client.js'
const tg = new TelegramClient({
// ... same options as above
})
tg.run({
phone: '+1234567890',
code: () => prompt('Enter the code:'),
password: 'my-password',
}, async (user) => {
console.log(`✨ logged in as ${user.displayName}`)
})
Generated using TypeDoc