6Labs >

6Labs SDK for Unity

This section explains how to integrate the 6Labs SDK into your Unity apps.

Prerequisites

  • Unity 2021 LTS or later is required. Earlier versions may work but are not actively supported.
  • Apple platforms only — Ensure the following tools are installed on your development machine:
    • Xcode 26.2 or higher
    • CocoaPods 1.12.0 or higher
  • Your Unity project must meet the following minimum deployment targets:
    • iOS — iOS 15 or higher
    • tvOS — tvOS 15 or higher
    • Android — API level 23 (Android 6.0 Marshmallow) or higher

1. Download and Import the Module

The 6Labs SDK is included as a Unity package file.

Add the module to your Unity project:

  1. Download the latest version v2.0.7 of the 6Labs SDK for Unity.
  2. Import the package into your Unity project:
    • Click on Assets > Import Package > Custom Package.
    • Select the downloaded .unitypackage file from your system.
    • Click on Import.

2. Start Observing Gameplay

Use the Init() method to initialize the SDK and start observing gameplay, as illustrated below:

using SixLabs.SDK;

SixLabsSDK.Instance.Init( inGameId: "<optional_player_in_game_id>",
developerPayload: "<optional_developer_payload_here>"
);

Important Information

  • If inGameId is not passed, the observed session may be discarded and will not be used for AI analysis. Without it, sessions cannot be attributed to a player, which is required for downstream insights.
  • Ensure that you obtain user consent before observing gameplay. The SDK does not automatically request permission; consent handling must be implemented in your game logic.
  • As a suggested best practice, you may include a disclosure of gameplay observation in your game’s EULA or privacy policy.
  • Ensure your app has the necessary internet permission enabled for your target platform.
  • The SDK does not function within the Unity Editor. To properly test it, you need to create a platform-specific build and run it on a physical device.

Reference

The following is the method reference for the Init() method.

Method Signature

public void Init(string inGameId = null, string developerPayload = null)

Parameters

Parameter Type Required Description
inGameId string No An optional but recommended user identifier. If omitted, the session may be discarded and will not be used for AI analysis.
developerPayload string No Optional developer-defined metadata associated with the session. This value is forwarded as-is with the session request and can be used to attach custom tracking or contextual information. Providing richer developerPayload can significantly improve AI-powered analysis and session understanding.
Example:

  • Acquisition channel
  • Campaign ID
  • User segment (e.g., new, returning, whale)
  • A/B test variant (e.g., variant_a, variant_b) — split users into cohorts and compare gameplay metrics across them in the 6Labs dashboard.
  • Internal reference identifiers

3. Set In-Game ID

Use the SetInGameId() method to associate a player's in-game ID with an existing observation session. This is typically required when the SDK is initialized before the user account is created, and you want to link the signed-in user to the session that is already in progress.

SixLabsSDK.Instance.SetInGameId("<player_in_game_id>");

Note

  • If inGameId was provided during Init(), calling SetInGameId() will overwrite the previously set value for the current session.

Reference

The following is the method reference for the SetInGameId() method.

Method Signature

public void SetInGameId(string inGameId)

Parameters

Parameter Type Required Description
inGameId string Yes The player's in-game identifier to associate with the current session.

4. Advanced Controls

In most integrations, calling Init() is sufficient to begin observing gameplay. For advanced or custom control, you may also use Resume() and Pause() directly.

4.1 Resume

Use the Resume() method to resume gameplay observation.

SixLabsSDK.Instance.Resume( inGameId: "<optional_player_in_game_id>",
developerPayload: "<optional_developer_payload_here>"
);

Method Signature

public void Resume(string inGameId = null, string developerPayload = null)

Parameters

Parameter Type Required Description
inGameId string No An optional but recommended user identifier. If omitted, the session may be discarded and will not be used for AI analysis.
developerPayload string No Optional developer-defined metadata associated with the session. This value is forwarded as-is with the session request and can be used to attach custom tracking or contextual information. Providing richer developerPayload can significantly improve AI-powered analysis and session understanding.

4.2 Pause

Use the Pause() method to pause gameplay observation.

SixLabsSDK.Instance.Pause();

Important Information

  • Pauses the gameplay observation.
  • You can call Resume() again later to resume gameplay observation.
×

Table of Contents

6labs SDK for Unity

Table of Contents

Text copied to clipboard
Questions? Please reach out to us at dev-support@6labs.ai