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 SixLabsSDK-1.1.10.unitypackage.

Add the module to your Unity project:

  1. Download the package containing the latest version of 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 user identifier within the game. If not passed, it defaults to an empty string.
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. Advanced Controls

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

3.1 Start Observing

Use the StartSession() method when you want to explicitly control when gameplay observation begins.

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

Method Signature

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

Parameters

Parameter Type Required Description
inGameId string No An optional user identifier within the game. If not passed, it defaults to an empty string.
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.

3.2 Stop Observing

Use the StopSession() method to stop observing gameplay.

SixLabsSDK.Instance.StopSession();

Important Information

  • Stops the gameplay observation.
  • You can call StartSession() again later to start gameplay observation.
×

Table of Contents

6labs SDK for Unity

Table of Contents

Document Rev. 1.0

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