Unity SDK

Remote Config + A/B Test Setup Wizard

A 7-step Unity editor wizard that generates a typed config ScriptableObject and optional manager MonoBehaviour, with A/B test helpers wired in from the start.

Prerequisites

  • KalmForge SDK installed in your Unity project.
  • API key configured in Window → KalmForge.
  • Newtonsoft.Json (HAS_NEWTONSOFT_JSON define) for Remote Config. A/B Tests alone do not require it.

What it is

Open from KalmForge → Remote Config Setup Wizard. A 7-step wizard that covers both Remote Config and A/B Tests and writes a typed ScriptableObject plus an optional manager script that you can drop on any GameObject.

Wizard steps

  1. Overview
  2. Settings - SDK + API key sanity check
  3. Newtonsoft.Json check
  4. Configure
  5. Generate
  6. Preview
  7. Finish

Newtonsoft.Json check

Looks for the HAS_NEWTONSOFT_JSON define symbol. If it's missing, the wizard routes you to the main Project Setup Wizard to install it.

Note
A/B Tests work without Newtonsoft.Json. Remote Config does not - the ScriptableObject relies on it for deserialisation.

Configure step

Configure step fields
NameTypeDescription
Class namestringDefault GameRemoteConfig. Becomes the ScriptableObject type.
Include A/B Test helpersboolWires ABTests.Fetch and exposure logging into the manager.
Generate RemoteConfigManager MonoBehaviourboolAdds a ready-to-drop manager script for the scene.
Fields tableSection / Key / Type / DefaultEditable rows (Type ∈ float | int | bool | string) with add and delete per row.

Generated files

Snake_case keys are converted to camelCase field names. The ScriptableObject ships with [CreateAssetMenu] so you can create an asset from the Project window.

Assets/KalmForge/Generated/GameRemoteConfig.csC#
1using KalmForge;
2using UnityEngine;
3
4[CreateAssetMenu(menuName = "KalmForge/Game Remote Config")]
5public class GameRemoteConfig : RemoteConfigScriptableObject
6{
7 [ConfigurableField("gameplay", "enemy_speed")]
8 public float enemySpeed = 1.0f;
9
10 [ConfigurableField("gameplay", "starting_lives")]
11 public int startingLives = 3;
12
13 [ConfigurableField("ui", "show_tutorial")]
14 public bool showTutorial = true;
15}
Assets/KalmForge/Generated/RemoteConfigManager.csC#
1using KalmForge;
2using UnityEngine;
3
4public class RemoteConfigManager : MonoBehaviour
5{
6 public GameRemoteConfig config;
7
8 void Awake()
9 {
10 RemoteConfig.OnConfigLoaded += HandleConfig;
11 ABTests.OnAssignmentsLoaded += HandleAssignments;
12 }
13
14 void HandleConfig() { /* config fields are now overwritten with live values */ }
15
16 void HandleAssignments()
17 {
18 // Example A/B branching:
19 // if (ABTests.IsInVariant("checkout_v2", "treatment")) { ... }
20 }
21}

Live preview

In Play Mode the Preview step calls RemoteConfig.Fetch() and ABTests.Fetch(logExposure: false) and displays each configured key's resolved value - including any A/B overrides.

How it works at runtime

Any field tagged [ConfigurableField(section, key)] on a RemoteConfigScriptableObject is overwritten when RemoteConfig.Init() runs. A/B test rc_overrides are then applied on top automatically. In the editor, OnDisable resets fields to their authored values so your design-time defaults are never lost.

Next steps

Back to DocsKalmForge SDK · v1.0.1