# @ensdomains/ensjs

> ENS javascript library for contract interaction

Latest version **4.3.1** (published 2026-06-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ensdomains/ensjs
pnpm add @ensdomains/ensjs
yarn add @ensdomains/ensjs
bun add @ensdomains/ensjs
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.3.1 |
| Published | 2026-06-24 |
| First published | 2020-10-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=22 |
| Dependencies | 10 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 156 |
| Author | TateB <yo@taytems.xyz> |
| Maintainers | makoto_inoue, nickjohnson, jefflau, mdt., leeondamiky, taytems, adraffy, v1rtl |

## Links

- npm: https://www.npmjs.com/package/@ensdomains/ensjs
- Repository: git@github.com:ensdomains/ensjs.git
- npm.io page: https://npm.io/package/@ensdomains/ensjs

## Dependencies (10)

- [pako](https://npm.io/package/pako.md) ^2.1.0
- [abitype](https://npm.io/package/abitype.md) ^1.0.0
- [graphql](https://npm.io/package/graphql.md) ^16.11.0
- [dns-packet](https://npm.io/package/dns-packet.md) ^5.3.1
- [ts-pattern](https://npm.io/package/ts-pattern.md) ^5.4.0
- [graphql-request](https://npm.io/package/graphql-request.md) 7.1.2
- [@adraffy/ens-normalize](https://npm.io/package/@adraffy/ens-normalize.md) 1.10.1
- [@ensdomains/dnsprovejs](https://npm.io/package/@ensdomains/dnsprovejs.md) 0.5.1
- [@ensdomains/content-hash](https://npm.io/package/@ensdomains/content-hash.md) ^3.1.1
- [@ensdomains/address-encoder](https://npm.io/package/@ensdomains/address-encoder.md) 1.1.3

## Recent versions

- 4.3.1 (latest) — 2026-06-24
- 5.0.0-sepolia-fix.1 (sepolia-fix) — 2026-05-26
- 4.2.0 (next) — 2025-11-17
- 5.0.0-alpha.1 (alpha) — 2025-11-05
- 0.0.0-feat-new-dnssec-oracle-updated.20240123T214835358 (rc-branch) — 2024-01-23
- 4.3.0 — 2026-06-19
- 4.2.3 — 2026-05-29
- 5.0.0-sepolia-fix.0 — 2026-05-26
- 4.2.2 — 2026-01-28
- 5.0.0-alpha.0 — 2025-11-05
- 4.1.2 — 2025-09-15
- 4.1.1 — 2025-08-22
- 4.1.0 — 2025-08-22
- 4.0.3-alpha.12 — 2025-01-13
- 4.0.3-alpha.11 — 2025-01-10
- … 109 more at https://npm.io/package/@ensdomains/ensjs/versions

## README

# ![ENSjs](https://user-images.githubusercontent.com/11844316/161689061-98ea01ee-b119-40ac-a512-5370eb8b4107.svg)

The ultimate ENS javascript library, with [viem](https://github.com/wagmi-dev/viem) under the hood.

## Features

- Super fast response times
- Easy call batchability
- Written in TypeScript
- Supports the most cutting edge ENS features
- Full tree-shaking support

## Installation

Install @ensdomains/ensjs, alongside [viem](https://github.com/wagmi-dev/viem).

```sh
npm install @ensdomains/ensjs viem
```

## Getting Started

The most simple way to get started is to create a public ENS client, with a supported
chain and transport imported from viem. The public client has all the read functions available on it,
as well as all subgraph functions.

```ts
// Import viem transport, viem chain, and ENSjs
import { http } from 'viem'
import { mainnet } from 'viem/chains'
import { createEnsPublicClient } from '@ensdomains/ensjs'

// Create the client
const client = createEnsPublicClient({
  chain: mainnet,
  transport: http(),
})

// Use the client
const ethAddress = client.getAddressRecord({ name: 'ens.eth' })
```

## Docs

Docs can be found [here](https://github.com/ensdomains/ensjs-v3/tree/main/docs).

---
_Source: https://npm.io/package/@ensdomains/ensjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
