Overview
This guide walks you through creating and using offchain ENS subnames with the@thenamespace/offchain-manager SDK. You’ll be able to create a subname, and then read records.
Prerequisites
- Node.js 18+ and a package manager (npm or yarn)
- An ENS name you manage (e.g.,
myensname.eth) - A Namespace API key (from the Namespace App)
Get an API Key
Follow this guide to create and copy your API key from the Namespace App.
1
Install and initialize the SDK
Install the Offchain SDK and dotenv to load your API key from an environment variable:Initialise the client with the network you want to use and your API key. We recommend setting your API key via an environment variable and keeping it secret by using server-side code.
- npm
- yarn
2
Check if a subname is available
Use Expected output (if available):
isSubnameAvailable before creating a subname to avoid overwriting an existing one.3
Create the subname with optional records
Create a subname under your parent name. You can include text records, address records, owner, and metadata.Expected output:
4
Filter subnames by owner
Fetch all subnames you own or created by filtering on Example output:
owner (or by metadata).5
Look up text records
Retrieve a single text record or all text records on a subname.Example output:
6
Look up address records
Address records are included in the subname response. A simple way to read them is via Example output:
getFilteredSubnames and then inspecting addresses.Next steps
- Update records on an existing subname using
updateSubname - Explore more filters with
getFilteredSubnames - See supported chains in
ChainName
ENS Client Compatibility
Subnames created with the Offchain SDK can be accessed and resolved using any of the eligible ENS client libraries like wagmi, viem, ethers, and others listed in the ENS Tools & Libraries documentation.Reverse Resolution Limitation: Offchain subnames do not support reverse resolution, so you cannot fetch a profile from an address. However, you can still set address records on offchain subnames for forward resolution.

