> ## Documentation Index
> Fetch the complete documentation index at: https://docs.namespace.ninja/llms.txt
> Use this file to discover all available pages before exploring further.

# Offchain SDK Installation

> Learn how to install and initialize the Namespace Offchain SDK for managing ENS subnames and records.

Install the Offchain SDK using your preferred package manager:

<Tabs>
  <Tab title="Npm">
    ```bash theme={null}
    npm install @thenamespace/offchain-manager
    ```
  </Tab>

  <Tab title="Yarn">
    ```bash theme={null}
    yarn add @thenamespace/offchain-manager
    ```
  </Tab>
</Tabs>

## Creating a Client

To interact with the Offchain SDK, create a client instance. You can obtain your API key from the [Namespace App](https://app.namespace.ninja/offchain?activeTab=apiKeys).

<Tabs>
  <Tab title="Default">
    ```typescript theme={null}
    import { createOffchainClient } from "@thenamespace/offchain-manager";

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

  <Tab title="Network Configuration">
    ```typescript theme={null}
    import { createOffchainClient } from "@thenamespace/offchain-manager";

    const client = createOffchainClient({ 
      mode: "sepolia" 
    });
    ```
  </Tab>

  <Tab title="Address-based API Key">
    ```typescript theme={null}
    import { createOffchainClient } from "@thenamespace/offchain-manager";

    const client = createOffchainClient({
      mode: "sepolia",
      defaultApiKey: "your-address-based-api-key"
    });
    ```
  </Tab>

  <Tab title="Domain-based API Keys">
    ```typescript theme={null}
    import { createOffchainClient } from "@thenamespace/offchain-manager";

    const client = createOffchainClient({
      mode: "sepolia",
      domainApiKeys: {
        "example.eth": "your-domain-based-api-key",
        "test.eth": "another-domain-key"
      }
    });
    ```
  </Tab>
</Tabs>

### 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
