> ## 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.

# Unity SDK

Native C# bindings for Passport authentication, wallet operations, and blockchain data queries.

> [!NOTE]
>
> **Who is this for?** Game developers using Unity who want to integrate web3 features, NFTs, and blockchain functionality into their games.

## Platform Compatibility

| Unity Version | Windows | macOS | Android | iOS |
| - | - | - | - | - |
| **Unity 6** | ✅ Full support | ✅ Full support | ✅ Full support | ✅ Full support |
| **2021.3 LTS+** | ✅ Full support | ✅ Full support | ✅ Full support | ✅ Full support |

> [!WARNING]
>
> **Unity 6 Android Users**: If using Unity 6 with Android, you must set the Application Entry Point to `Activity` (not the default `GameActivity`). See [Unity 6 Configuration](#unity-6-configuration) below.

## Prerequisites

* **Unity**: 2021.3 LTS or later
* **.NET Standard**: 2.1
* **UniTask**: The [UniTask](https://github.com/Cysharp/UniTask) package (v2.3.3) is a required dependency of our SDK. Follow the instructions [here](https://github.com/Cysharp/UniTask#upm-package) to install it.
* **Git LFS**: The SDK repository uses [Git Large File Storage](https://git-lfs.github.com/) to manage `.dll` files and other binary assets. Install Git LFS before cloning or Unity Package Manager may fail to download binary dependencies correctly.

## Installation

1. Install [UniTask](https://github.com/Cysharp/UniTask#upm-package) v2.3.3 or later

   The UniTask package is a dependency of our SDK.

2. Install [Git LFS](https://git-lfs.github.com/)

   > [!WARNING]
   >
   > Git LFS must be installed **before** adding the SDK. The SDK contains `.dll` files stored in Git LFS that won't download correctly otherwise.

3. Add the Immutable SDK:

> [tab] Package Manager
>
> 1. Open **Window** → **Package Manager**
> 2. Click **+** and select **Add package from git URL...**
> 3. Enter `https://github.com/immutable/unity-immutable-sdk.git?path=/src/Packages/Passport` and click **Add**

> [tab] manifest.json
>
> 1. Open your project's `Packages/manifest.json` file
> 2. Add the following in the `dependencies` block:
>
> ```json theme={null}
> "com.immutable.passport": "https://github.com/immutable/unity-immutable-sdk.git?path=/src/Packages/Passport"
> ```

#### Install a Specific Version

To install a specific version of the SDK using either method above, append `#` followed by the version tag to the git URL:

```
https://github.com/immutable/unity-immutable-sdk.git?path=/src/Packages/Passport#v1.0.0
```

For mobile platform setup (Android, iOS), see [Platform-Specific Configuration](https://docs.immutable.com/docs/sdks/unity/overview.md#platform-specific-configuration).

### Unity 6 Configuration

> [!WARNING]
>
> **Unity 6 Android Required**: If using Unity 6 with Android, you must configure the Application Entry Point.

1. Go to **Project Settings** → **Player** → **Android** → **Other Settings** → **Configuration**
2. Set **Application Entry Point** to `Activity` (not `GameActivity`)
3. Open `AndroidManifest.xml` and remove the `UnityPlayerGameActivity` activity block; keep only the `UnityPlayerActivity` block

## Platform-Specific Configuration

> [tab] Windows
>
> ### Platform Requirements
>
> * **Windows**: 10 or later
>
> ### Scripting Backend Support
>
> | Backend | Support | Notes |
> | - | - | - |
> | **Mono** | ✅ Fully supported | Uses default Unity Web Browser (UWB) |
> | **IL2CPP** | ⚠️ Requires custom WebView | See [Advanced Configuration](https://docs.immutable.com/docs/sdks/unity/advanced-configuration.md) for Vuplex setup |
>
> ### Default WebView Setup
>
> The SDK uses [Unity Web Browser (UWB)](https://github.com/Voltstro-Studios/UnityWebBrowser) by default on Windows. UWB is not bundled with the SDK, so you must install it.
>
> 1. Add the VoltUPR registry and required scopes, then install UWB via the Package Manager. See the [UWB GitHub repo](https://github.com/Voltstro-Studios/UnityWebBrowser) and [VoltUPR setup guide](https://upr.voltstro.dev/-/web/about).
>
> 2. Import these packages:
>    * `dev.voltstro.unitywebbrowser`
>    * `dev.voltstro.unitywebbrowser.engine.cef`
>    * `dev.voltstro.unitywebbrowser.engine.cef.win.x64`
>
> 3. Confirm **UWB\_WEBVIEW** is present in your project after the packages are installed.
>
> > [!NOTE]
> >
> > For IL2CPP builds, use a custom WebView like Vuplex. See [Advanced Configuration](https://docs.immutable.com/docs/sdks/unity/advanced-configuration.md).

> [tab] macOS
>
> ### Platform Requirements
>
> * **macOS**: 12.5 or later
>
> No additional configuration required for macOS.

> [tab] Android
>
> ### Platform Requirements
>
> * **Minimum Android Version**: 10 or later (API Level 24+)
> * **Target API**: 33 or higher recommended
>
> ### Enable custom manifest and Gradle
>
> 1. Go to **Edit** → **Project Settings** → **Player** → **Android**
> 2. Expand **Publishing Settings**
> 3. In **Build**, enable **Custom Main Manifest** and **Custom Main Gradle Template**
>
> Unity generates `Assets/Plugins/Android/AndroidManifest.xml` and `Assets/Plugins/Android/mainTemplate.gradle`. Edit these files (or your existing custom ones) as below.
>
> ### AndroidManifest.xml
>
> Add this activity inside the `<application>` element. Set `android:scheme` and `android:host` to match the redirect URIs you use in Passport (e.g. `mygame` and `callback` for `mygame://callback`):
>
> ```xml theme={null}
> <activity
>   android:name="com.immutable.unity.RedirectActivity"
>   android:exported="true" >
>   <intent-filter android:autoVerify="true">
>     <action android:name="android.intent.action.VIEW" />
>     <category android:name="android.intent.category.DEFAULT" />
>     <category android:name="android.intent.category.BROWSABLE" />
>     <data android:scheme="mygame" android:host="callback" />
>     <data android:scheme="mygame" android:host="logout" />
>   </intent-filter>
> </activity>
> ```
>
> ### mainTemplate.gradle
>
> Add the Chrome Custom Tabs dependency inside the `dependencies` block:
>
> ```gradle theme={null}
> implementation('androidx.browser:browser:1.5.0')
> ```
>
> > [!NOTE]
> >
> > For `androidx.browser:browser:1.5.0`, **Target API Level** must be at least 33. Set it under **Edit** → **Project Settings** → **Player** → **Android** → **Other Settings** → **Target API Level**.
>
> ### Manual Manifest Configuration (Advanced)
>
> If automatic merging doesn't work for your project, you can manually configure `AndroidManifest.xml`:
>
> ```xml theme={null}
> <activity android:name="com.unity3d.player.UnityPlayerActivity"
>           android:exported="true">
>   <!-- ... existing intent filters ... -->
>
>   <!-- Add deep link intent filter -->
>   <intent-filter android:autoVerify="true">
>     <action android:name="android.intent.action.VIEW" />
>     <category android:name="android.intent.category.DEFAULT" />
>     <category android:name="android.intent.category.BROWSABLE" />
>     <data android:host="callback" android:scheme="mygame" />
>     <data android:host="logout" android:scheme="mygame" />
>   </intent-filter>
> </activity>
> ```

> [tab] iOS
>
> ### Platform Requirements
>
> * **iOS Version**: 15.2 or later
>
> ### URL Scheme Configuration
>
> Add your custom URL scheme to `Info.plist`:
>
> ```xml theme={null}
> <key>CFBundleURLTypes</key>
> <array>
>     <dict>
>         <key>CFBundleURLSchemes</key>
>         <array>
>             <string>mygame</string>
>         </array>
>     </dict>
> </array>
> ```
>
> Or configure in Unity:
>
> 1. Go to **Edit** → **Project Settings** → **Player** → **iOS** → **Other Settings** → **Supported URL schemes**
> 2. Increase **Size** by 1
> 3. Enter your URL scheme in the new **Element** slot (e.g. `mygame` for `mygame://callback`)

The SDK handles deep links automatically. Ensure your redirect URIs match your configured URL scheme.

> [!NOTE]
>
> Your redirect URIs (like `mygame://callback`) must use the same URL scheme that you configure in your platform settings:
>
> * **iOS**: Only the scheme needs to match (e.g., `mygame` in `mygame://callback`)
> * **Android**: Both the scheme AND host must match (e.g., `mygame` and `callback` in `mygame://callback`)
>
> See [Initialize Passport](https://docs.immutable.com/docs/products/passport/authentication.md#initialize-passport) for authentication setup.

```csharp theme={null}
// Must match your URL scheme
passport = await Passport.Init
(
    clientId: "YOUR_CLIENT_ID",
    environment: Environment.Sandbox,
    redirectUri: "mygame://callback",      // ← mygame matches URL scheme config
    logoutRedirectUri: "mygame://logout"
);
```

## Next Steps

### Getting Started

> [card] [Configure Your Project](https://hub.immutable.com)
>
> Set up credentials and OAuth client in Immutable Hub

> [card] [Authentication](https://docs.immutable.com/docs/products/passport/authentication.md)
>
> Initialize Passport and implement login

> [card] [Wallet Operations](https://docs.immutable.com/docs/products/passport/wallet.md)
>
> Access wallet addresses and balances

> [card] [Game Bridge Architecture](https://docs.immutable.com/docs/sdks/game-bridge-architecture.md)
>
> Understand SDK internals and custom engine integration

### Additional Resources

> [card] [Advanced Configuration](https://docs.immutable.com/docs/sdks/unity/advanced-configuration.md)
>
> Custom WebView, IL2CPP support

> [card] [FAQ](https://docs.immutable.com/docs/sdks/unity/faq.md)
>
> Common questions and troubleshooting

> [card] [GitHub](https://github.com/immutable/unity-immutable-sdk)
>
> SDK source code and samples


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.