Skip to content

ensdomains/ensjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f32562c · Apr 30, 2025
Sep 23, 2024
Dec 30, 2022
Jan 7, 2025
Jun 27, 2024
Apr 30, 2025
Apr 21, 2025
Nov 10, 2024
Feb 13, 2024
Jul 6, 2023
Sep 23, 2024
Aug 19, 2024
Mar 16, 2022
Dec 6, 2022
Jul 9, 2023
Sep 23, 2024
Oct 14, 2024
Jul 6, 2023
Aug 25, 2022

Repository files navigation

ENSjs

The ultimate ENS javascript library, with 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.

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.

// 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. Full docs site coming soon.