For AI agents: a documentation index is available at /llms.txt. A markdown version of this page is available at the same URL with .md appended (or via Accept: text/markdown).
Skip to main content

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 Unity application's specific requirements.

Configuration structure

Pass a Web3AuthOptions instance to setOptions when you initialize the SDK:

web3Auth = GetComponent<Web3Auth>();

web3Auth.setOptions(new Web3AuthOptions(){
clientId = "<YOUR_CLIENT_ID>",
web3AuthNetwork = Web3Auth.Network.SAPPHIRE_MAINNET,
redirectUrl = new Uri("<YOUR_SCHEME>://<YOUR_APP_PACKAGE_NAME>/auth"),
});

Web3AuthOptions

The setOptions method takes a Web3AuthOptions instance.

ParameterDescription
clientIdClient ID from the MetaMask Developer dashboard.
web3AuthNetworkSapphire network. Use SAPPHIRE_DEVNET for testing and SAPPHIRE_MAINNET for production.
redirectUrlURL that receives the authentication response. It must match the dashboard and deep-link settings.
authConnectionConfig?Custom authentication connections as a List<AuthConnectionConfig>.
whiteLabel?Branding and localization settings as WhiteLabelData.
walletServicesConfig?Wallet Services confirmation and branding settings as WalletServicesConfig.
defaultChainId?Initial Wallet Services chain ID. The default is 0x1.
mfaSettings?MFA factor settings as MfaSettings.
sessionTime?Session duration in seconds. The default is 86,400 seconds.
enableLogging?Whether SDK logging is enabled. The default is false.

Session management

Control how long users stay authenticated and how sessions persist in Unity.

Key Configuration Options:

  • sessionTime - Session duration in seconds. Controls how long users remain authenticated before they must sign in again.
    • Minimum: 1 second (1).
    • Maximum: 30 days (86400 * 30).
    • Default: 1 day (86400).
web3Auth.setOptions(new Web3AuthOptions(){
clientId = "<YOUR_CLIENT_ID>",
web3AuthNetwork = Web3Auth.Network.SAPPHIRE_MAINNET,
sessionTime = 86400 * 7, // 7 days (in seconds)
redirectUrl = new Uri("<YOUR_SCHEME>://<YOUR_APP_PACKAGE_NAME>/auth"),
});

Custom authentication methods

Control the login options presented to your users. For detailed configuration options and implementation examples, see the custom authentication section.

UI customization

Customize the brand experience by customizing the Embedded Wallets login screens to match your Unity application's design. For complete customization options, refer to the whitelabeling and UI customization section.

Multi-Factor Authentication (MFA)

Add additional security layers to protect user accounts with two-factor authentication. For detailed configuration options and implementation examples, see the Multi-Factor Authentication section.

Key Configuration Options:

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

Dapp share

Share authentication sessions across different applications. For detailed configuration options and implementation examples, see the dapp share section.