Install the Offchain SDK using your preferred package manager:
npm install @thenamespace/offchain-manager

Creating a Client

To interact with the Offchain SDK, create a client instance. You can obtain your API key from https://dev.namespace.ninja.
import { createOffchainClient } from "@thenamespace/offchain-manager";

// Defaults to mainnet
const client = createOffchainClient();
client.setDefaultApiKey("your-address-based-api-key");

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