- React
You can also use Privy to connect a user’s external wallet if they have one, or to create an embedded wallet for them if they do not. This ensures users always have a connected wallet they can use with your application, and allows them to choose to use their external wallet if preferred.To do so, use the This method will prompt the user to connect an external wallet, or log in with email, SMS, or socials, depending on your configured For example, you might have a “Connect” button in your app that prompts users to connect their wallet, like so:
connectOrCreateWallet method of the usePrivy hook:loginMethods, to create an embedded wallet.Privy’s
connectOrCreate interface currently only supports external and embedded wallets on EVM
networks.Callbacks
You can optionally pass callbacks to theuseConnectOrCreateWallet hook to run custom logic after connecting a wallet or to handle errors.onSuccess
Parameters
The most recently connected wallet.
onError
Parameters
The error that occurred during the this flow.

