thirdweb-dev / js

Best in class web3 SDKs for Browser, Node and Mobile apps
https://thirdweb.com
Apache License 2.0
380 stars 259 forks source link

Add Magic Link to v5 #2903

Closed JoaoCampos89 closed 2 months ago

JoaoCampos89 commented 2 months ago

Hi, I am trying to add Magic Link on v5, but It seems is better to add it directly here. What is the best approach? Create a pull request?

The way v5 was built it will be really hard for anyone add custom wallets in their own app, as it depends heavily on WalletId interface, which is used across all functions.

Using inApp is not a option as I will not ask users to switch accounts.

gregfromstl commented 2 months ago

Hi @JoaoCampos89, thanks for opening an issue. Could you share a bit more about what you're trying to do with Magic Link? Our inApp wallets support email, phone, and social login (same as Magic Link) and we have some more "advanced" configuration options that let you bring your own auth I could walk you through.

What do you mean when you say you won't ask users to switch accounts? Could you provide a step-by-step of the user experience you're aiming for and we can try to find the solution that fits best?

Also PRs would be much appreciated if you think you know what needs to be added for your use case!

JoaoCampos89 commented 2 months ago

If I already created a wallet with magic link, will thirdweb recreate the same wallet if I use same email?

gregfromstl commented 2 months ago

If I already created a wallet with magic link, will thirdweb recreate the same wallet if I use same email?

It will not, each email + client ID combination maps to a unique in-app wallet address. Are you looking to migrate your users from Magic Link to thirdweb?

JoaoCampos89 commented 2 months ago

Yes, but if the address is different, it will not work. I need at the moment to use another solution for connecting wallets that is more flexible