From the course: Building Web3 Decentralized Apps in Ethereum

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Authenticating users with MetaMask

Authenticating users with MetaMask

- [Instructor] Now that we've included ethers.js into our UI, Let's look at how we can use it to build out our DApp and talk to the wallet. With ethers.js, as we discussed, there's two key interfaces, there's the provider and there's the signer. Now the provider is the main methodology through which we talk to the blockchain. And in fact, when we create a provider, it can help us to determine how we want to talk to it. So by default, it's going to talk to the main net, but we can set it for one of the test nets or localhost or using an API like Infura or Alchemy, which we'll discuss in another video. Now, there are a number of different providers depending how you want to connect. We're actually going to use the Web3Provider. This one's nice because it essentially allows you to talk to MetaMask and use MetaMask objects. So that way we're going to be talking to the provider through the wallet and through what's being…

Contents