Usage
Prerequisites
- You will need to have the Magic SDK installed into your web app
- You will need to have the Magic SDK - OAuth Extension installed into your web app
Telegram Setup
After installing the OAuth extension, you can now enable Telegram Login for your Magic app:- Follow Telegram instructions to create a bot
- Provide Bot name and Bot Token in your Magic developer dashboard
- Optionally enable Seamless login with Mini App
- Copy the Redirect URI field from your Magic Dashboard and set it as your bot domain using command
/setdomainin @BotFather
If you have CSP enforcement, allow the following script-src:
Implementation
JavaScript
The shape of
magic.userMetadata (typed as MagicUserMetadata) differs by SDK version. On SDK v30.0.0+, wallet addresses are nested under a wallets object — access the Ethereum address via result.magic.userMetadata.wallets?.ethereum?.publicAddress. On SDK v29.x and below, the address is available as a flat field: result.magic.userMetadata.publicAddress. See the getInfo SDK reference for full response shapes and migration details.