> For the complete documentation index, see [llms.txt](/llms.txt).

# Advanced configuration

The Embedded Wallets SDK provides extensive configuration options that allow you to customize authentication flows, UI appearance, blockchain integrations, and security features to meet your application's specific requirements.

## Configuration structure[​](#configuration-structure "Direct link to Configuration structure")

When setting up Web3Auth, you'll pass in the options to the constructor. This consists of:

```
import Web3Auth

web3Auth = Web3Auth(W3AInitParams(
    clientId: "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable // Get your Client ID from MetaMask Developer Dashboard
    network: .sapphire_mainnet, // or .sapphire_devnet
    redirectUrl: "com.yourapp.bundleid://auth"
))

```

### `W3AInitParams`[​](#w3ainitparams "Direct link to w3ainitparams")

The Web3Auth Constructor takes an object with `W3AInitParams` as input.

- Table
- Struct

| Parameter    | Description                                                                                                                 |
| ------------ | --------------------------------------------------------------------------------------------------------------------------- |
| clientId     | Your Web3Auth Client ID from the [Dashboard](https://developer.metamask.io/). It's a mandatory field of type String.        |
| network      | Web3Auth Network: .sapphire_mainnet, .sapphire_devnet, .mainnet, .cyan, .aqua or .testnet. Mandatory field of type Network. |
| redirectUrl  | URL that Web3Auth will redirect API responses upon successful authentication. It's a mandatory field of type String.        |
| whiteLabel?  | Whitelabel options for custom UI, branding, and translations. Takes \`W3AWhiteLabelData\`\` as a value.                     |
| loginConfig? | Login config for custom verifiers. Takes [String: W3ALoginConfig] as a value.                                               |
| mfaSettings? | Configure MFA settings for authentication. Takes MfaSettings as a value.                                                    |
| sessionTime? | Configure session management time in seconds. Default is 86400 seconds (1 day). Max 30 days.                                |

```
public struct W3AInitParams {
    public let clientId: String
    public let network: Network
    public let redirectUrl: String
    public let whiteLabel: W3AWhiteLabelData?
    public let loginConfig: [String: W3ALoginConfig]?
    public let useCoreKitKey: Bool?
    public let chainNamespace: ChainNamespace?
    public let mfaSettings: MfaSettings?
    public let sessionTime: Int?

    public init(
        clientId: String,
        network: Network,
        redirectUrl: String,
        whiteLabel: W3AWhiteLabelData? = nil,
        loginConfig: [String: W3ALoginConfig]? = nil,
        useCoreKitKey: Bool? = nil,
        chainNamespace: ChainNamespace? = .eip155,
        mfaSettings: MfaSettings? = nil,
        sessionTime: Int? = 86400
    )
}

```

## Session management[​](#session-management "Direct link to Session management")

Control how long users stay authenticated and how sessions persist. The session key is stored in the device's encrypted Keychain.

**Key Configuration Options:**

- `sessionTime` - Session duration in seconds. Controls how long users remain authenticated before needing to sign in again.  
  - Minimum: 1 second (`1`).
  - Maximum: 30 days (`86400 * 30`).
  - Default: 7 days (`86400 * 7`).

```
web3Auth = Web3Auth(W3AInitParams(
    clientId: "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable // Get your Client ID from MetaMask Developer Dashboard
    network: .sapphire_mainnet, // or .sapphire_devnet
    sessionTime: 86400 * 7, // 7 days (in seconds)
    redirectUrl: "com.yourapp.bundleid://auth"
))

```

## Custom authentication methods[​](#custom-authentication-methods "Direct link to Custom authentication methods")

Control the sign-in options presented to your users. For detailed configuration options and implementation examples, see the [custom authentication](/embedded-wallets/sdk/ios/advanced/custom-authentication/) section.

## UI customization[​](#ui-customization "Direct link to UI customization")

Create a seamless brand experience by customizing the Web3Auth Sign-in Screens to match your application's design. For complete customization options, refer to the [Whitelabeling and UI Customization](/embedded-wallets/sdk/ios/advanced/whitelabel/) section.

## Multi-Factor Authentication[​](#multi-factor-authentication "Direct link to Multi-Factor Authentication")

Add additional security layers to protect user accounts with two-factor authentication. For detailed configuration options and implementation examples, see the [Multi-Factor Authentication](/embedded-wallets/sdk/ios/advanced/mfa/) section.

**Key Configuration Options:**

- `mfaSettings` - Configure MFA settings for different authentication flows
- `mfaLevel` - Control when users are prompted to set up MFA
