Telegram
Telegram is an end to end encrypted messaging platform with in-application experiences.
Privy enables your application to easily integrate Login with Telegram in multiple ways. From a regular web environment, users can authenticate to your application with their Telegram account.
Privy also enables seamless login within Telegram, so users can zero-click authenticate to your Telegram bot or mini-app. Check out our recipe for setting up seamless login with Telegram.
To authenticate your users with Telegram, use the useLoginWithTelegram
hook.
Usage
Before using the useLoginWithTelegram
hook, ensure that Telegram is enabled in Socials tab of the Login Methods page on the the Privy dashboard
Tracking Flow State
Track the state of the Telegram authentication flow via the state
variable returned by the
useLoginWithTelegram
hook.
The current state of the Telegram authentication flow.
The error that occurred during the Telegram authentication flow.
Callbacks
You can optionally pass callbacks into the useLoginWithTelegram
hook to run custom logic after a successful login or to handle errors that occur during the flow.
onComplete
Parameters
The user object corresponding to the authenticated user.
Whether the user is a new user or an existing user.
Whether the user entered the application already authenticated.
The method used by the user to login.
The account corresponding to the loginMethod used.
onError
Parameters
The error that occurred during the login flow.
Was this page helpful?