OptionalabortSignal?: AbortSignalAbort signal
OptionalbotToken?: MaybeDynamic<string>Bot token to use. Ignored if phone is supplied.
Optionalcode?: MaybeDynamic<string>Code sent to the phone (either sms, call, flash call or other).
Ignored if botToken is supplied, must be present if phone is supplied.
OptionalcodeSentCallback?: (code: SentCode) => MaybePromise<void>Custom method that is called when a code is sent. Can be used to show a GUI alert of some kind.
This method is called before start.params.code.
OptionalcodeSettings?: Omit<RawCodeSettings, "_" | "logoutTokens">Additional code settings to pass to the server
OptionalforceSms?: booleanWhether to force code delivery through SMS
OptionalfutureAuthTokens?: Uint8Array[]Saved future auth tokens, if any
OptionalinvalidCodeCallback?: (type: "code" | "password") => MaybePromise<void>If passed, this function will be called if provided code or 2FA password was invalid. New code/password will be requested later.
If provided code/password is a constant string, providing an
invalid one will interrupt authorization flow.
Optionalpassword?: MaybeDynamic<string>2FA password. Ignored if botToken is supplied
Optionalphone?: MaybeDynamic<string>Phone number of the account. If account does not exist, it will be created
OptionalqrCodeHandler?: (url: string, expires: Date) => voidWhen passed, QR login flow will be used instead of the regular login flow.
This function will be called whenever the login URL is changed, and the app is expected to display it as a QR code to the user.
Optionalsession?: string | InputStringSessionDataString session exported using TelegramClient.exportSession.
This simply calls TelegramClient.importSession before anything else.
Note that passed session will be ignored in case storage already contains authorization.
OptionalsessionForce?: booleanWhether to overwrite existing session.
Start the client in an interactive and declarative manner, by providing callbacks for authorization details.
This method handles both login and sign up, and also handles 2FV
All parameters are
MaybeDynamic<T>, meaning you can either supplyT, or a function that returnsMaybePromise<T>This method is intended for simple and fast use in automated scripts and bots. If you are developing a custom client, you'll probably need to use other auth methods.