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

# Configuration Options

> All options for the Near class constructor

These are the properties accepted by the `Near` class constructor.

```typescript theme={null}
const near = new Near({
  network: "testnet",
  privateKey: "...",
})
```

## Network

Controls which NEAR network to connect to.

<ResponseField name="network" type="string | NetworkConfig" required>
  The network to connect to.

  **Presets:** `"mainnet"`, `"testnet"`, `"localnet"`

  **Custom config:**

  ```typescript theme={null}
  {
    networkId: "my-private-net",
    rpcUrl: "http://127.0.0.1:3030"
  }
  ```

  **Sandbox:** Passing a `Sandbox` instance automatically configures RPC and the root account key.
</ResponseField>

<ResponseField name="rpcUrl" type="string">
  Override the RPC URL for a preset network (e.g., to use a specific provider like Infura or Lava).
</ResponseField>

<ResponseField name="headers" type="Record<string, string>">
  Custom HTTP headers for RPC requests.

  ```typescript theme={null}
  { "Authorization": "Bearer ..." }
  ```
</ResponseField>

## Credentials & Signing

`near-kit` checks these in order: `wallet` > `signer` > `privateKey` > `keyStore`.

<ResponseField name="privateKey" type="string">
  A single private key (`ed25519:...`). Useful for scripts.
</ResponseField>

<ResponseField name="keyStore" type="KeyStore">
  A storage backend for multiple keys.

  | KeyStore           | Environment | Description                                 |
  | ------------------ | ----------- | ------------------------------------------- |
  | `InMemoryKeyStore` | Any         | Default, keys in memory                     |
  | `FileKeyStore`     | Node.js     | Stores in `~/.near-credentials`             |
  | `NativeKeyStore`   | Node.js     | macOS Keychain / Windows Credential Manager |
  | `RotatingKeyStore` | Any         | For high-concurrency apps                   |
</ResponseField>

<ResponseField name="wallet" type="WalletAdapter">
  A wrapper around a browser wallet.

  ```typescript theme={null}
  wallet: fromHotConnect(connector)
  ```
</ResponseField>

<ResponseField name="signer" type="(hash: Uint8Array) => Promise<Signature>">
  A custom signing function. Use this for hardware wallets, KMS, or multi-sig logic.
</ResponseField>

<ResponseField name="defaultSignerId" type="string">
  The account ID to use when calling `near.transaction()` without arguments.
</ResponseField>

## Execution Behavior

<ResponseField name="defaultWaitUntil" type="string" default="EXECUTED_OPTIMISTIC">
  Controls how long `.send()` waits before returning.

  | Value                   | Description                                                         |
  | ----------------------- | ------------------------------------------------------------------- |
  | `"INCLUDED"`            | Return as soon as the network accepts it (fastest, no result value) |
  | `"EXECUTED_OPTIMISTIC"` | Transaction is executed and result is available (default)           |
  | `"FINAL"`               | Wait for BFT finality (safest, slowest)                             |
</ResponseField>

<ResponseField name="retryConfig" type="object">
  Configuration for automatic retries on network errors.

  <Expandable title="properties">
    <ResponseField name="maxRetries" type="number" default={4}>
      Maximum retries for retryable network errors (429, 503, etc).
    </ResponseField>

    <ResponseField name="initialDelayMs" type="number" default={1000}>
      Initial backoff delay in milliseconds.
    </ResponseField>
  </Expandable>
</ResponseField>
