useMagic
Hook that prompts users to connect to your app using Magic Auth or Magic Connect
import { useMagic } from "@thirdweb-dev/react";
The magicLink also needs to be added in ThirdwebProvider's supportedWallets if you want the wallet to auto-connect on next page load.
Magic apiKey
Magic SDK requires an apiKey for instantiation. You can create a apiKey
for your app on magic.link
Usage
calling this hook returns a connect
function.
Magic offers two flavors of our SDK: Magic Connect, which provides a plug-and-play experience, and Magic Auth, a customizable white-labeled wallet solution.
// in a react component
const connect = useMagic();
// when you want to connect
const magicWallet = await connect(connectOptions);