This section explains how to integrate the 6Labs SDK into your Unity apps.
The 6Labs SDK is included as a Unity package file.
Add the module to your Unity project:
v2.0.7 of the 6Labs SDK for Unity..unitypackage file from your system.Use the Init() method to initialize the
SDK and
start observing gameplay, as
illustrated
below:
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.The following is the method reference for the
Init() method.
| 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:
|
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.
inGameId was provided during Init(), calling SetInGameId() will overwrite the previously set value for the current session.The following is the method reference for the
SetInGameId() method.
| Parameter | Type | Required | Description |
|---|---|---|---|
inGameId |
string |
Yes | The player's in-game identifier to associate with the current session. |
In most integrations, calling Init() is
sufficient to begin observing gameplay. For
advanced or
custom control, you may also use
Resume() and
Pause() directly.
Use the Resume() method to resume gameplay observation.
| 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. |
Use the Pause() method to pause gameplay observation.
Resume()
again later to resume gameplay observation.