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

# Configuration

> SDK initialization parameters and network setup

# Configuration

Once you have an [App ID](/sdk/concepts/app-setup), initialize the SDK with a configuration object specifying your endpoints and target chain.

## Required Parameters

| Parameter   | Type     | Description                                                            |
| ----------- | -------- | ---------------------------------------------------------------------- |
| `serverUrl` | `string` | URL of the Privacy Boost server                                        |
| `appId`     | `string` | Your application identifier (see [App Setup](/sdk/concepts/app-setup)) |

## Optional Parameters

| Parameter               | Type     | Description                                                                           |
| ----------------------- | -------- | ------------------------------------------------------------------------------------- |
| `chainId`               | `number` | EVM chain ID for the target network (auto-discovered from server)                     |
| `shieldContractAddress` | `string` | Address of the deployed Shield contract (auto-discovered from server)                 |
| `wethContractAddress`   | `string` | WETH contract address (required for native ETH deposits)                              |
| `rpcUrl`                | `string` | JSON-RPC URL for on-chain reads (token registry lookups)                              |
| `logLevel`              | `string` | Console log verbosity: `"silent"` (default), `"error"`, `"warn"`, `"info"`, `"debug"` |

## Example

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { PrivacyBoost } from '@sunnyside-io/privacy-boost';

  const sdk = await PrivacyBoost.create({
    serverUrl: 'https://optimism.sepolia.privacyboost.io',
    wethContractAddress: '0x4200000000000000000000000000000000000006',
    appId: 'app_abc123xyz',
  });
  ```

  ```swift iOS theme={null}
  import PrivacyBoost

  let config = PrivacyBoostConfig(
      serverUrl: "https://optimism.sepolia.privacyboost.io",
      wethContractAddress: "0x4200000000000000000000000000000000000006",
      appId: "app_abc123xyz"
  )
  let sdk = try await PrivacyBoost(config: config)
  ```

  ```kotlin Android theme={null}
  import com.privacyboost.sdk.*

  val config = PrivacyBoostConfig(
      serverUrl = "https://optimism.sepolia.privacyboost.io",
      wethContractAddress = "0x4200000000000000000000000000000000000006",
      appId = "app_abc123xyz"
  )
  val sdk = PrivacyBoost(config)
  ```

  ```bash CLI theme={null}
  # Via environment variables
  export PRIVACY_BOOST_APP_ID=app_abc123xyz
  export SERVER_URL=https://optimism.sepolia.privacyboost.io
  export WETH_CONTRACT_ADDRESS=0x4200000000000000000000000000000000000006
  export RPC_URL=https://sepolia.optimism.io

  privacy-boost login

  # Or use a network preset
  privacy-boost --network op-sepolia login
  ```
</CodeGroup>

## Supported Networks

| Network    | Chain ID   | `serverUrl`                                | Description                                            |
| ---------- | ---------- | ------------------------------------------ | ------------------------------------------------------ |
| OP Mainnet | `10`       | `https://optimism.privacyboost.io`         | Optimism mainnet (production)                          |
| OP Sepolia | `11155420` | `https://optimism.sepolia.privacyboost.io` | Optimism Sepolia testnet (recommended for development) |

## CLI Environment Variables

The CLI reads configuration from environment variables:

| Variable                           | Description                                          |
| ---------------------------------- | ---------------------------------------------------- |
| `PRIVACY_BOOST_APP_ID` or `APP_ID` | Application identifier                               |
| `SERVER_URL`                       | Privacy Boost server URL                             |
| `SHIELD_CONTRACT_ADDRESS`          | Shield contract address (auto-discovered if omitted) |
| `WETH_CONTRACT_ADDRESS`            | WETH contract address                                |
| `RPC_URL`                          | JSON-RPC URL                                         |

```bash theme={null}
export PRIVACY_BOOST_APP_ID=app_abc123xyz
export SERVER_URL=https://optimism.sepolia.privacyboost.io

privacy-boost login
```

## Logging

By default, the SDK produces **no console output** (`silent`). Set `logLevel` to control verbosity during development or debugging:

| Level      | Output                                       |
| ---------- | -------------------------------------------- |
| `"silent"` | No output (default)                          |
| `"error"`  | Errors only                                  |
| `"warn"`   | Errors and warnings                          |
| `"info"`   | Errors, warnings, and informational messages |
| `"debug"`  | All messages including verbose debug output  |

<CodeGroup>
  ```typescript TypeScript / React theme={null}
  const sdk = await PrivacyBoost.create({
    serverUrl: 'https://optimism.sepolia.privacyboost.io',
    appId: 'app_abc123xyz',
    logLevel: 'debug', // Enable verbose logging for development
  });
  ```
</CodeGroup>

<Info>
  Use `"debug"` during development to trace SDK operations. In production, leave it as `"silent"` (the default) or `"error"` to avoid leaking internal state to the browser console.
</Info>

All log messages are tagged with the originating module (e.g., `[Vault]`, `[Auth]`) for easy filtering in browser dev tools.

## Multi-Chain Configuration

To operate on additional chains beyond your primary one, create chain clients with `sdk.forChain()`. Only `serverUrl` is required — all other parameters are auto-discovered:

```typescript theme={null}
const ethereum = sdk.forChain({ serverUrl: 'https://eth.example.com' });
const base = sdk.forChain({
  serverUrl: 'https://base.example.com',
  chainId: 8453,
  wethContractAddress: '0x4200000000000000000000000000000000000006',
});
```

| Parameter               | Type     | Required | Description                               |
| ----------------------- | -------- | -------- | ----------------------------------------- |
| `serverUrl`             | `string` | Yes      | URL of this chain's server                |
| `chainId`               | `number` | No       | EVM chain ID (auto-discovered)            |
| `shieldContractAddress` | `string` | No       | Shield contract address (auto-discovered) |
| `wethContractAddress`   | `string` | No       | WETH contract address                     |
| `rpcUrl`                | `string` | No       | RPC URL for on-chain reads                |
| `tokenRegistryAddress`  | `string` | No       | Token registry contract (auto-discovered) |
| `teePublicKey`          | `string` | No       | TEE public key (auto-discovered)          |

See [Multi-Chain](/sdk/concepts/multi-chain) for the full guide.

## Next Steps

<CardGroup cols={2}>
  <Card title="Authentication" href="/sdk/concepts/authentication">
    Connect a wallet and log in
  </Card>

  <Card title="Key Management" href="/sdk/concepts/key-management">
    Key derivation, persistence, and recovery
  </Card>

  <Card title="Multi-Chain" href="/sdk/concepts/multi-chain">
    Operate across multiple blockchains
  </Card>
</CardGroup>
