# Wallet configuration

Pass a `walletConfig` object to `OpenfortProvider`. The shared options below apply to every chain. For chain-specific setup, follow the Ethereum or Solana guide. For UI-specific options (`uiConfig`), see [UI configuration](/docs/products/embedded-wallet/react/ui/configuration).

<HoverCardLayout>
  <HoverCardLink href="/docs/products/embedded-wallet/react/wallet/ethereum" title="Ethereum" description="Chain ID, account type, fee sponsorship, RPC URLs, and the wagmi bridge." icon={Ethereum} />

  <HoverCardLink href="/docs/products/embedded-wallet/react/wallet/solana" title="Solana" description="Cluster, RPC URLs, commitment level, and UI options." icon={Solana} />
</HoverCardLayout>

## Shared options

These options apply regardless of chain. Set `ethereum` and/or `solana` for chain-specific configuration.

| Option | Type | Description |
|--------|------|-------------|
| `shieldPublishableKey` | `string` | **Required.** Shield API publishable key. |
| `createEncryptedSessionEndpoint` | `string` | API endpoint that creates an encrypted session. **Mutually exclusive** with `getEncryptionSession`. |
| `getEncryptionSession` | `(params) => Promise<string>` | Callback to retrieve an encryption session. **Mutually exclusive** with `createEncryptedSessionEndpoint`. |
| `requestWalletRecoverOTPEndpoint` | `string` | API endpoint for requesting wallet recovery OTP. **Mutually exclusive** with `requestWalletRecoverOTP`. |
| `requestWalletRecoverOTP` | `(params) => Promise<void>` | Callback to request wallet recovery OTP. **Mutually exclusive** with `requestWalletRecoverOTPEndpoint`. |
| `passkeyDisplayName` | `string` | Display name in passkey creation dialog. |
| `connectOnLogin` | `boolean` | Create and recover the wallet automatically after auth. Default: `true`. Set to `false` for manual control via `wallet.create()`. |
| `chainType` | `ChainTypeEnum` | Which chain type to activate on first mount. Default: `EVM`. |
| `ethereum` | `EthereumConfig` | Chain ID, RPC URLs, fee sponsorship, account type, and assets. See [Ethereum configuration](/docs/products/embedded-wallet/react/wallet/ethereum). |
| `solana` | `SolanaConfig` | Cluster, RPC URLs, commitment level, and UI options. See [Solana configuration](/docs/products/embedded-wallet/react/wallet/solana). |

:::info
Need transaction examples? See [Wallet actions](/docs/products/embedded-wallet/react/wallet/actions) for `wallet_sendCalls` usage and gas sponsorship tips.
:::

## connectOnLogin

By default, an embedded wallet is automatically created and recovered after authentication. Set `connectOnLogin` to `false` to take full control of wallet creation.

```tsx
<OpenfortProvider
  publishableKey="pk_..."
  walletConfig={{
    shieldPublishableKey: "416cd...",
    connectOnLogin: false, // [!code focus]
  }}
>
  {/* Check wallet.wallets.length === 0 and call wallet.create() explicitly */}
</OpenfortProvider>
```

:::info
When disabled, wallets are not silently created or recovered during auth flows or chain switches. Check `wallet.wallets.length === 0` after auth and call `wallet.create()` yourself.
:::
