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

# Advanced Configuration

> Custom WebView, IL2CPP support, and advanced SDK configuration

## Custom Windows WebView

The default Unity Web Browser (UWB) doesn't support IL2CPP. For IL2CPP builds or more control, integrate a third-party WebView.

### Vuplex Integration

[Vuplex](https://vuplex.com/) is a commercial WebView that supports IL2CPP.

#### 1. Install Vuplex

1. Purchase [Vuplex Windows WebView](https://developer.vuplex.com/webview/overview)
2. Import the `.unitypackage` from your Vuplex dashboard
3. Include `Core/` and `Standalone/` directories (skip `Mac/`)

#### 2. Implement the Interface

Create a class implementing `IWindowsWebBrowserClient`:

```csharp theme={null}
#if UNITY_STANDALONE_WIN

using Cysharp.Threading.Tasks;
using Immutable.Browser.Core;
using Vuplex.WebView;

public class VuplexWebView : IWindowsWebBrowserClient
{
    public event OnUnityPostMessageDelegate OnUnityPostMessage;
    private IWebView webView;

    public VuplexWebView()
    {
        webView = Web.CreateWebView();
    }

    public async UniTask Init()
    {
        await webView.Init(1, 1);

        webView.MessageEmitted += (sender, eventArgs) =>
        {
            OnUnityPostMessage?.Invoke(eventArgs.Value);
        };
    }

    public void LoadUrl(string url)
    {
        webView.LoadUrl(url);
    }

    public async void ExecuteJavaScript(string js)
    {
        await webView.ExecuteJavaScript(js);
    }

    public string GetPostMessageApiCall()
    {
        return "window.vuplex.postMessage";
    }

    public void Dispose()
    {
        webView.Dispose();
    }
}

#endif
```

#### 3. Initialize with Custom WebView

```csharp theme={null}
passport = await Passport.Init(clientId, environment
#if UNITY_STANDALONE_WIN || (UNITY_EDITOR_WIN && UNITY_STANDALONE_WIN)
    , windowsWebBrowserClient: new VuplexWebView()
#endif
);
```

#### 4. Configure Scripting Defines

1. Go to **File** → **Build Settings** → **Player Settings**
2. Navigate to **Player** → **Other Settings**
3. Add `IMMUTABLE_CUSTOM_BROWSER` to **Scripting Define Symbols**
4. Click **Apply**

This excludes the default WebView from your build.

#### 5. Exclude Vuplex from Non-Windows Builds

Follow [Vuplex's platform exclusion guide](https://support.vuplex.com/articles/exclude-from-build) to prevent Vuplex from being included in non-Windows builds.

***

## Custom Timeout Configuration

Override default timeouts for SDK operations:

```csharp theme={null}
// Set custom timeout (default is 60 seconds)
passport.SetCallTimeout(TimeSpan.FromMinutes(2));
```

***

## Session Persistence

The SDK automatically persists sessions. To manually control:

```csharp theme={null}
// Check for existing session
bool hasSession = await passport.HasCredentialsSaved();

if (hasSession)
{
    // Silent login (no UI)
    await passport.Login(useCachedSession: true);
}
else
{
    // Full login flow
    await passport.Login();
}
```

***

## Logging

The Passport SDK provides logging so you can monitor and troubleshoot its behaviour. You can set the log level and optionally redact sensitive data from logs.

### Log level

Use the `LogLevel` property to control the severity of logged messages. The default is `LogLevel.Info`.

| Level            | Description                                 |
| ---------------- | ------------------------------------------- |
| `LogLevel.Debug` | Detailed information for debugging          |
| `LogLevel.Info`  | General SDK operation information (default) |
| `LogLevel.Warn`  | Warnings about potential issues             |
| `LogLevel.Error` | Errors indicating SDK failures              |

```csharp theme={null}
// Set log level to Debug for verbose output
Passport.LogLevel = LogLevel.Debug;
```

### Redacting sensitive tokens in logs

By default, access and ID tokens are logged in full. Set `RedactTokensInLogs` to `true` to replace them with `[REDACTED]` in log output.

```csharp theme={null}
Passport.RedactTokensInLogs = true;
```

Use this when debugging or sharing logs to avoid exposing sensitive data.

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Platform Setup" icon="mobile" href="/docs/sdks/unity/overview#platform-specific-configuration">
    iOS, Android configuration
  </Card>

  <Card title="FAQ" icon="circle-question" href="/docs/sdks/unity/faq">
    Common questions
  </Card>
</CardGroup>
