I am building a Telegram Bot which can create a wallet for the user and want to integrate web3auth for creating and storing wallet keys. Since this is a chat based application, I cannot open different popups for social logins.
I want to setup a wallet on bot start command. I will also give users an option to export their private keys if they want.
Please suggest if this is achievable using web3auth ?
Hi Abhith!
It sounds like an interesting project you’re working on! With Web3Auth, you can indeed integrate wallet creation and key storage seamlessly. However, since you’re developing a Telegram Bot and wish to avoid popups for social logins, you might want to look into using Web3Auth via custom authentication flows or JWT (JSON Web Tokens). Below are a few aspects to consider:
-
Custom Authentication: You can authenticate users using your own logic and pass the idToken to Web3Auth. This could be useful if you already have a user database or authentication mechanism without needing social logins.
-
JWT and JWKS: If you decide to handle authentication tokens yourself, ensure you have an endpoint (JWKS) to verify these tokens.
-
Passwordless Logins: Consider implementing a passwordless login flow using magic links or similar to simplify the process without popups.
Unfortunately, the plug-and-play nature of Web3Auth often involves popups for login but exploring custom integration might help achieve a more streamlined flow in your chat-based application.
If you decide to proceed with any of these, feel free to share further specifics or code snippets if you hit any roadblocks, and I’d be happy to help!
Good luck with your Telegram Bot project!
Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.
please refer this example for basic implementation
opt for https://github.com/Web3Auth/web3auth-pnp-examples/blob/main/web-no-modal-sdk/custom-authentication/single-verifier-examples/telegram-no-modal-example/src/App.tsx#L32
ux mode as redirect for redirect flow and to avoid popup
if you face any issues, please share the snippet for a more specific resolution
Hey @abhith this is possible. You can use the TG directly to login the user when the click on the start. To achieve this, you’ll have to create your own Telegram mini app server, I’ll share the resources below which will help you get started.
Demo TG bot: @w3a_tg_mini_app_bot
Guide Client Side: Client-Side Setup for Telegram Mini App with Web3Auth | Web3Auth
Guide Server Side: Server-Side Setup for Telegram Mini App with Web3Auth | Web3Auth
Also, you can give the option to export their private key. It’s possible with Web3Auth. You can check the docs here: https://web3auth.io/docs/connect-blockchain/evm/ethereum/web#fetch-users-private-key
Please note we are use the SFA JS SDK for the mini-app.