Skip to content

sumicet/web3auth-modal-wagmi

Repository files navigation

Web3Auth Modal + Wagmi v0

This is an example project of how to integrate web3auth modal together with wagmi.

Why this choice of technologies?

The web3auth modal provides web3 social authentication. It automatically creates a new wallet and injects a web3 provider for each user who logs in using social providers (google, twitter, discord, etc.).

wagmi is an ethereum hook library, great when dealing with web3 transactions.

This repo showcases how to:

  • Solve the vite polyfill issue
  • Implement eager connection
  • Make additional requests during authentication (eg call your BE server to authenticate the user)
  • Close the modal when errors happen during the authentication
  • Listen to modal events
  • Handle the case when the web3auth session expires

Result: a unified deterministic and finite auth state. Call useAccount to get isConnected and address.