Skip to main content

What is Web3Auth?

Visit Web3Auth docs to get more information.
Web3Auth is a pluggable auth infrastructure for Web3 wallets and applications. It streamlines the onboarding of mainstream and crypto-native users in under a minute by providing experiences they’re most comfortable with. With support for all social logins, web and mobile-native platforms, wallets, and other key management methods, Web3Auth results in a standard cryptographic key provider specific to the user and application.

Before Starting

You can start this tutorial if you already have a NextJS dapp with MetaMask sign-in functionality.Installing the Web3Auth Wagmi Connector Install the @web3auth/web3auth-wagmi-connector dependency:
npm2yarn

Configuring the Web3Auth Wagmi Connector

  1. Open the pages/signin.jsx file and add Web3AuthConnector as a connector to the useConnect() hook:

Testing the Web3Auth Connector

Visit http://localhost:3000/signin to test authentication.
  1. Click on Authenticate via Web3Auth
  2. Select the preferred sign-in method
  3. After successful authentication, you will be redirected to the /user page
  4. Visit http://localhost:3000/user to test the user session’s functionality: