If you are using the modular SDK, ensure you are including
@dynamic-labs/magic package and exporting
Using Dynamic and Magic wallets together will allow your users to log in with either email or social while a wallet is created in the background, creating a user friendly option for non-web 3 native users. To learn more about Magic, see their website here.
To add magic wallets to your sign up flow:
- Go to Magic and sign up
- Create a Magic Auth app
- Click into the new Magic Auth app and verify you have access to your app credentials. You can find your publishable API key and secret key on in the home page of your Magic Auth project
- Keep these close by since you’ll need to copy them into the Dynamic Dashboard
Enable Email sign up
- Go to your Configurations page in the Dynamic Dashboard
- Open the
Sign up with Email or Socialcard
- Toggle on
Enable Email Sign + Magic.link
- Add your Magic Auth credentials
- Select your preferred default network
- If you have more than 1 supported EVM network, click on the dropdown and select the network that Magic should use to generate the wallet. This is a Magic requirement to set up a wallet, but worry not, your users will be able to switch networks after logging in.
- Press save
Enable Social Sign in
Social sign in is currently available on v17 RC07+. If you want to get early access to this feature, reach out to us in our Community Slack Channel.
To enable social sign in:
- You’ll first need to setup your social oauth credentials in the Magic dashboard.
- To learn more about how to do so, see the Magic documentation. Here is a link to their Google example.
- Now that your social apps are setup in Magic, you can now go to the Dynamic Dashboard and simply toggle them on.
- Only toggle on social apps that are configured in Magic. If you toggle on a social app that is not properly configured in Magic, then users will hit an error state.
- Ensure you test the connection in Magic before enabling in the Dynamic dashboard.
Use the wallets
For users that sign up with these wallets in the background, you will be to access these wallets as you would any other wallet.
signTransaction is an unsupported method with MagicAuth. Make sure to use either the sendTransaction or signMessage methods.
Exporting Private Keys
Magic supports the export of users private keys by creating a reveal site where your users can log in using the same login methods as your app.
This website is created on demand, so we recommend you reach out to them by using the chat widget in the bottom-right corner of the documentation page with the following information:
- Your API key (starts with pk_live)
- Your logo
- The list login methods you offer
- A list of blockchains you are using
- Your app name for the endpoint, such as https://reveal.magic.link/your-app-name
Check out the sample reveal site here for reference.