/setdomain
command in the @BotFather
chat. You will need to provide the following to Privy via the Privy Dashboard upon completion:
1234567890:AzByCxDwEvFuGtHsIr1k2M4o5Q6s7U8w9Y0
)@MyBot_bot
)script-src
must allow https://telegram.org
in order to be able to download Telegram’s widget script.frame-src
must allow https://oauth.telegram.org
in order to be able to render Telegram’s widget iframe.http://web.telegram.org
and https://web.telegram.org
to your allowed domains in the dashboard Configuration > App
settings > Domains tab.loginMethods
loginMethods
configured client-side in your PrivyProvider
config, make sure you add "telegram"
to that list as well. Client-side login method configuration is only necessary if you want to restrict logins to a subset of those configured in the Dashboard.
login
from the usePrivy
hook in this case!t.me/xxx_bot/xxx
)'telegram'
when configuring login methods client-side, in the PrivyProvider
.
linkTelegram
and unlinkTelegram
methods from the usePrivy
hook to add or remove Telegram accounts from a user. See the SDK reference for more details:
linkTelegram
methods from the usePrivy
hook within a Telegram Mini App to add to a user seamlessly by passing launchParams
as a parameter. See the SDK reference for more details:
launchParams
are treated as expired after five minutes for security.user
object contains information about all of the accounts a user has linked with Privy.
TelegramAccount
extends LinkedAccount
Field | Type | Description |
---|---|---|
type | ’telegram’ | N/A |
telegram_user_id | string | ID of a user’s telegram account. |
first_name | string | The first name displayed on a user’s telegram account. |
last_name | string | (Optional) The last name displayed on a user’s telegram account. |
username | string | (Optional) The username displayed on a user’s telegram account. |
photo_url | string | (Optional) The url of a user’s telegram account profile picture. |