Practical overview
When it fits
Use ENSjs when building a TypeScript application that already uses viem and needs composable ENS reads or wallet actions. It is also relevant when the application needs ENS subgraph or DNS helpers, or when developers want to import only selected ENS actions.
Who it is for
- TypeScript developers adding ENS resolution and record lookups to Ethereum applications
- Teams building ENS registration or name-management interfaces with viem
- Developers who need ENS subgraph queries, DNS helpers or contract ABI snippets
Documented uses
- Resolve ENS names and retrieve address, text and other records
- Check name price or availability and support registration and renewal flows
- Build ENS v1 or v2 wallet operations, including supported record and name-management actions
- Query subnames, names associated with addresses and history through the subgraph module
- Use DNS helpers or import ENS contract ABI snippets
Requirements & limits
The repository is public and identifies the project license as MIT. The README lists viem 2.9.2 or later as a peer dependency.
- The core integration is built around viem clients rather than a standalone user-facing interface.
- The README lists mainnet and Sepolia as supported chains.
- GraphQL is needed for the subgraph entry point; dnsprovejs is needed for the documented DNS import-data helper.
- React hooks and query integration are provided as separate repository packages.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up ENS record reads with viem
Create a viem public client extended with ENS contracts and use it to request ENS records.
Before you start
- TypeScript project
- viem 2.9.2 or later
- Install pnpm and the @ensdomains/ensjs package
Steps
Install the library and viem with
pnpm add @ensdomains/ensjs viem.Import
httpandcreatePublicClientfrom viem,mainnetfromviem/chains, andaddEnsContractsfrom ENSjs.Create a public client with
chain: addEnsContracts(mainnet)and an HTTP transport.Import read actions from
@ensdomains/ensjs/publicand callgetAddressRecordorgetRecordswith the client and a name.
Expected outcome
A viem client configured with ENS contract information can request address and other records, as shown in the README example.
Guide limitations
- The documented example targets mainnet; the README also lists Sepolia as supported.
- This recipe covers read operations only; write actions use wallet-oriented entry points and standard viem write parameters.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 12 October 2026
- Original website title
- ensdomains/ensjs · Official homepage title · retained in its source language

