Key Export
Key Export
#Dedicated Wallet
#SDK Method
This method is currently only available through our web, React Native, and Android SDKs. For all other SDKs, refer to our Reveal Page section below.
Implementing this SDK method will allow your end users to access their private key. Be sure to read through this document carefully before implementing.
For Dedicated Wallet apps, you can use Magic's user.revealPrivateKey
method to allow your users to view their private keys. Implementing this method will allow your end users to back up their private keys or take them to another wallet. Neither Magic nor the developer can see this key; only the end user can.
#Usage
Once you have verified the correct setup of the Magic SDK and successfully authenticated the user, the reveal private key modal can then be displayed by calling the revealPrivateKey
method:
01import { Magic } from 'magic-sdk';
02
03const magic = new Magic('PUBLISHABLE_API_KEY');
04
05try {
06 await magic.user.revealPrivateKey();
07} catch {
08 // Handle errors if required!
09}
#Reveal Page
For non-web SDK apps, Magic creates a private key reveal page for your users to log into using the same login methods as your app. This page is only made for your app upon request. When the user logs in they will follow some intuitive prompts to reveal their private key.
If you would like your users to be able to view and export their private key, please contact us using the chat widget in the bottom-right corner of this page with the following information:
- Your API key (starts with
pk_live
) - A list of blockchains you are using
- Your app name for the endpoint, such as
https://reveal.magic.link/your-app-name
The login methods available on your reveal page will match the login methods that you have activated in your Magic developer dashboard (found under "Passwordless Login" and "Social Login").
Please make sure to deactivate any login methods that you are not using. Login methods can be added and removed at any point and changes will be immediately visible on your reveal page.
The look of the UI for your reveal page will also match the settings configured within the "branding" section of your developer dashboard. This includes the logo shown, the primary color, as well as choosing between light/dark mode. More details on branding and UI customization can be found here.
#Universal Wallet
Universal wallets will soon be merged with Dedicated Wallets into a single product line. Universal apps created before February 7, 2024 will work as expected with no change. See our blog post to learn more.
For Universal Wallet apps, users can view their seed phrase directly through wallet.magic.link.
Once signed in, click on the profile icon in the top left corner and then select "Wallet Secret Phrase".