---
title: "Connect with Unity"
description: "Connect a Unity mobile game and verify a published Experience in an iOS or Android player."
sidebar:
  label: "Unity"
search:
  tags: ["sdk", "setup", "unity"]
  keywords: ["C#", "IL2CPP", "Unity", "install", "initialize", "integration_test"]
---

The Unity SDK displays Nuxie Experiences above your game and provides a C# client for events, purchases, and feature access. Publish or update an onboarding flow or paywall without rebuilding the game. Use Unity 6000.3.24f1 with iOS and Android Build Support, iOS 15+, or Android API 25+ with IL2CPP arm64.

1. **Installation**

    <span id="prepare-and-install-the-package" />

    ## Installation [toc]

    From the [Unity SDK checkout](https://github.com/nuxieai/nuxie-unity), prepare the package:

    ```sh title="Prepare the Unity package"
    python3 scripts/prepare-native.py
    python3 scripts/pack.py
    ```

    In **Window → Package Manager → Install package from tarball**, select `com.nuxie.unity-0.2.0.tgz`. You can also open the repository's `ExampleProject`.

    The package includes Android artifacts and adds the Swift package on iOS export. Install the prepared tarball, not the repository root.

    <span id="configure-at-game-startup" />

2. **Initialize**

    ## Initialize [toc]

    Copy your app's public keys from **Connect your app**. Use `pk_test_` keys in development builds and `pk_live_` keys in release builds. Keep the default service environment for both; the key selects preview or live content.

    Configure once from startup code on Unity's main thread:

    ```csharp title="Game startup"
    using Nuxie.Unity;

    await Nuxie.Client.ConfigureAsync(new NuxieOptions {
        IosApiKey = "YOUR_IOS_PUBLIC_KEY",
        AndroidApiKey = "YOUR_ANDROID_PUBLIC_KEY"
    });
    ```

    Await setup before calling the client. Inspector-based projects can use a **Nuxie Settings** asset and **Nuxie Bootstrap**. The session continues across scene changes.

    <span id="check-the-connection" />

    Run your app on a device or simulator. **Connect your app** shows **Connected** after Nuxie receives a request from the SDK.

    <span id="prepare-the-experience-you-will-test" />
    <span id="add-a-test-trigger" />

3. **Trigger an Experience**

    ## Trigger an Experience [toc]

    [Publish an Experience](/docs/guides/publishing) for this app with the event trigger `integration_test`. Set its re-entry rule to **Every time** if you want to show it repeatedly while integrating. Add this call to a button handler after setup:

    ```csharp
    await Nuxie.Client.TriggerAsync("integration_test");
    ```

    Tapping the button sends the event. Nuxie displays the Experience when the customer matches its audience and delivery rules. For an existing Experience, replace `integration_test` with its published event name.

    <span id="show-the-experience" />

    **Connect your app** changes to **Shown** after the SDK reports that the Experience appeared. For games, run this in an iOS or Android player or export. Your game controls pause, audio, and input while the Experience is visible.

    <span id="try-a-remote-update" />

4. **Update an Experience**

    ## Update an Experience [toc]

    Edit the Experience and publish your changes. Bring the app back to the foreground to fetch the update, then send the event again with a customer who can re-enter. New Journeys use the updated version; a Journey already in progress keeps the version it started with. The app code stays the same.

    <span id="continue" />

    See the [SDK reference](/docs/reference/unity) for identity, feature access, and App Actions. [Delivery](/docs/guides/delivery) explains trigger and audience configuration.
