Skip to main content
Install the Offchain SDK using your preferred package manager. This page covers @thenamespace/offchain-manager 1.1.3, the latest release. See the Offchain SDK changelog for earlier versions.

Creating a Client

To interact with the Offchain SDK, create a client instance. You can obtain your API key from the Namespace App.

Configuration Options

  • mode: Network mode - choose between “mainnet” for production or “sepolia” for testing
  • timeout: Request timeout in milliseconds (optional)
  • defaultApiKey: Address-based API key for all domains registered to your address
  • domainApiKeys: Object mapping specific ENS domains to their API keys
  • customHeaders: HTTP headers sent with every request, such as a trace ID (optional). You can also set them later with client.setCustomHeaders(headers). The API key travels in the x-auth-token header, so an x-auth-token value here replaces it.
  • backendUri: Custom backend URL (optional). Defaults to the Namespace API for the selected mode.
The config also accepts Axios request options, which is where timeout comes from.