Skip to main content
Native C# bindings for Passport authentication, wallet operations, and blockchain data queries.

Requirements

  • Unity 2021.3 LTS or later
  • .NET Standard 2.1
  • Supported platforms: Windows, macOS, iOS, Android, WebGL

Installation

  1. Open WindowPackage Manager
  2. Click +Add package from git URL
  3. Enter: https://github.com/immutable/unity-immutable-sdk.git

Manual Installation

  1. Download from GitHub Releases
  2. Import the .unitypackage into your project

Quick Start

using Immutable.Passport;

public class GameManager : MonoBehaviour
{
    private Passport passport;

    async void Start()
    {
        passport = await Passport.Init(
            clientId: "YOUR_CLIENT_ID",
            environment: Environment.Sandbox,
            redirectUri: "mygame://callback",
            logoutRedirectUri: "mygame://logout"
        );
    }

    public async void Login()
    {
        await passport.Login();
        string address = await passport.GetAddress();
        Debug.Log($"Logged in: {address}");
    }

    public async void Logout()
    {
        await passport.Logout();
    }
}

SDK Architecture

The Unity SDK consists of:
ComponentPurpose
Immutable.PassportAuthentication and wallet operations
Immutable.ApiGenerated API clients (Indexer, Orderbook)
Immutable.BrowserWebView management for auth flows

How Authentication Works

  1. SDK loads an invisible WebView containing the auth bridge
  2. User clicks login → system browser opens (Chrome Custom Tabs / ASWebAuthenticationSession)
  3. User authenticates with identity provider (Google, Apple, etc.)
  4. Browser redirects back to your app via deep link
  5. SDK receives tokens and establishes session
The in-app browser is used instead of a WebView for security. Google and Apple block WebView authentication to prevent credential theft.

Sample Project

The SDK includes samples demonstrating:
  • Login/logout flow
  • Displaying user NFTs
  • Sending transactions
  • Marketplace integration
Import from Package ManagerImmutable SDKSamples.

Resources