Remote Configuration
Satori is a LiveOps product from Heroic Labs that supports remote configuration, AB experiments, user segmentation, and scheduled LiveOps events.
Satori Client Module is Lion’s package designed to facilitate and standardize the integration of Satori into Unity games.
LionSDK automatically:
- Initializes and authenticates the player to Satori
- Sets essential properties
- Logs important data (experiment name, etc.) to Analytics
- Fetches and stores Feature Flag values
LionSDK provides simple functions to:
- Access Feature Flag (remote configuration) values
- Fire Satori Events (to assign payers to audiences)
- Set Custom Properties
This document explains the client implementation of LionSDK. For more information on Satori’s features, see Satori Concept Documentation. For more information on how to set up the Satori dashboard for AB experiments, see: AB Experiments
Install LionSDK
- Complete the steps in Getting Started
Setup
-
Open the
LionStudios/Settings Manager
windowLion Settings Manager -
Fill up the information:
-
Client URL
: Provided by the PMNote: Do not include the “https://” portion of the link
-
Port
:443
-
API Key
: Go to the Satori Dashboard > Settings >API KEYs
to find the value -
Timeout Milliseconds
:5000
-
Editor Identity
: for Editor testing purposes. This can be left blank.Note: Defines the Identity of the user that will be shown on the Satori dashboard when testing from the Unity Editor.
-
Mab Key
: Leave this blank
-
-
Example Configuration for KingWing:
Example KingWing Settings
Usage
The following methods must be called after the LiveOps package has been initialized.
The module is part of LionSDK’s initialization cycle; you can use LionCore.IsInitialized
and LionCore.OnInitialized
to ensure that it is ready.
Example
void Start()
{
if (LionCore.IsInitialized)
InitFeatureFlagValues();
else
LionCore.OnInitialized += InitFeatureFlagValues;
}
void InitFeatureFlagValues()
{
// You can use SatoriController functions here
}
If you have a loading scene already waiting for LionCore initialization, you don’t have to worry about this in your game scene.
Get the value of a feature flag
Function signature
SatoriController.GetValue<T>(
string flagName,
T defaultValue)
This will return the value of the feature flag for the current player. The flag name is case-sensitive.
Examples
// If no flag exists for that key or if offline, it will return the
// default value (3).
int showAppReviewAfterLevel =
SatoriController.GetValue<int>("show_app_review_after_level", 3);
// Any type can be used. The flag value will be parsed to that type.
// For complex types, the flag value has to be formatted in json.
bool bonusLevelEnabled =
SatoriController.GetValue<bool>("bonus_level_enabled", false);
RemoteConfig.cs
Migration
If you were previously using the RemoteConfig.cs
script shared by Lion Studios, the functions are the same, but the class has been renamed from RemoteConfig
to SatoriController
Replace occurrences of RemoteConfig.
with SatoriController.
Example
Before
RemoteConfig.GetValue<int>("flag_name", 0);
After
SatoriController.GetValue<int>("flag_name", 0);