📇ENS Profile Resolution
Resolve ENS Profiles for users signing into a service
Requirements
ethers >= v5.5.3
The user's linked Ethereum Name Service (ENS) information can be retrieved after their Ethereum address is known. After the user connects with their wallet but before they Sign-In with Ethereum, ENS information can be used to provide additional context to the user about which account is connected.
If the user completes Sign-In with Ethereum to authenticate, the ENS data resolved from their Ethereum address may be used as part of the authenticated session, such as checking that the address's default ENS name is alisha.eth
before granting access to certain pages or resources.
The information can be retrieved using the ENS resolution methods in ethers:
The user's Avatar location can be resolved using ensResolver.getText
, butgetAvatar
is recommended as it resolves NFT avatars to a URL.
The EtherscanProvider
above uses a shared API key and is therefore rate-limited. For a production application, we strongly recommend using a new API key with Etherscan or another compatible provider.
Last updated