Magic Link Integration for Authentication in Crypto Mobile Applications
Magic (magic.link) is an SDK that combines passwordless email authentication with non-custodial wallet creation. User enters email, receives magic link, taps it — and is immediately authorized with a ready-made Ethereum address. No passwords, no seed.
Magic SDK Mechanics
Magic uses its own HSMs (Hardware Security Modules) to store parts of the private key. The full key is assembled only on the user's device in an isolated context after email verification. This scheme is called Delegated Key Management.
Unlike Privy and Web3Auth, Magic doesn't support recovery via another device without additional methods (MFA). If user loses email access — recovery is handled through Magic support.
Integration in React Native
npm install magic-sdk @magic-ext/react-native
Magic SDK on React Native works through a built-in WebView component (magic-sdk). You need to ensure react-native-webview is installed and configured.
import { Magic } from "@magic-sdk/react-native";
const magic = new Magic("pk_live_YOUR_PUBLISHABLE_KEY", {
network: {
rpcUrl: "https://mainnet.infura.io/v3/YOUR_KEY",
chainId: 1,
},
});
// Export provider for use with ethers.js
export const magicProvider = new ethers.BrowserProvider(magic.rpcProvider);
// Email login
const loginWithMagic = async (email: string) => {
try {
await magic.auth.loginWithMagicLink({
email,
showUI: true, // Magic shows its own waiting screen
});
const userInfo = await magic.user.getInfo();
// userInfo.publicAddress — wallet address
await saveUserSession(userInfo);
} catch (e) {
if (e instanceof RPCError && e.code === RPCErrorCode.MagicLinkExpired) {
showError("Link expired. Request a new one.");
}
}
};
Deep Link for Magic Link on Mobile
User receives email, taps link — browser should return control to the app. This requires Universal Link (iOS) or App Link (Android).
On iOS add Associated Domains in Info.plist: applinks:your-app.link. On the server — apple-app-site-association file. Magic Dashboard allows you to configure a custom redirect URL.
On Android — Intent Filter with autoVerify="true" and .well-known/assetlinks.json on the domain. Without this, the magic link opens in browser instead of the app.
Common issue: link opens in Chrome Custom Tab instead of app on Android 12+. Reason — Android 12 App Links policy changes. Solution: explicitly specify android:pathPattern in Intent Filter and verify via adb shell am start -W -a android.intent.action.VIEW.
Transaction Signing
const signTransaction = async (to: string, valueEth: string) => {
const signer = await magicProvider.getSigner();
const tx = await signer.sendTransaction({
to,
value: ethers.parseEther(valueEth),
gasLimit: 21000,
});
return tx.hash;
};
Magic automatically invokes transaction confirmation UI through its WebView — user sees details and confirms. You cannot customize this UI without an Enterprise plan.
Magic Link integration + Deep Links setup + transaction signing — 1–2 weeks. Cost estimated individually.







