Requirements
- Unity 2022 LTS or Unity 6+.
- .NET Standard 2.1 / 4.x scripting backend.
- An internet connection on first launch (the SDK caches everything to disk for offline play afterwards).
Install
- Download the latest
KalmForge.unitypackagefrom your dashboard. - In Unity: Assets → Import Package → Custom Package…, select all and import.
- The SDK lives under
Assets/Plugins/KalmForge/. Do not move theResources/subfolder - the runtime loadsKalmForgeSettingsviaResources.Load.
com.unity.mobile.notifications enables Local Notifications, and com.unity.services.authentication auto-binds your player_id to the signed-in Unity Authentication user.Project Setup Wizard
The SDK ships with an Editor wizard that installs dependencies and configures push notifications for you. Open it from KalmForge → Project Setup Wizard in the Unity menu bar - it also pops up automatically the first time the SDK compiles if anything is missing.
The wizard walks through seven steps:
- Overview - green-checks every step the SDK has already detected so you can skip ahead.
- Newtonsoft.Json - installs
com.unity.nuget.newtonsoft-jsonvia Package Manager (required for SDK download responses). - Firebase - downloads and imports Firebase Cloud Messaging from the KalmForge SDK store, or lets you browse for a local
.unitypackage. - Config files - drop
google-services.jsonandGoogleService-Info.plistonto the dropzones; the wizard copies them toAssets/at the correct location. - Android - patches
AndroidManifest.xmlwith the FCM intent filter,RECEIVE_BOOT_COMPLETED, and the default notification channel meta-data. - iOS - generates
Assets/KalmForge/iOS/Entitlements.entitlementsand an Xcode post-build processor that wires up Push Notifications + Background Modes on every build. - Finish - adds the
HAS_FIREBASE_PUSH_NOTIFICATIONSscripting define and re-verifies everything end-to-end.
.p8 credentials on the dashboard under Project → Notifications → Setup before sends will reach devices - see the Notifications guide.Configure
Open Window → KalmForge. The first time it runs it creates Assets/Resources/KalmForgeSettings.asset. Paste your Project ID and the API key for each environment you intend to ship to.
kf_. The SDK rejects anything else with InvalidOperationException at Init(). Never commit production keys to a public repo - use environment-specific keys.Boot the SDK
1using KalmForge;2using UnityEngine;34public class GameBoot : MonoBehaviour {5 async void Start() {6 await KalmForgeClient.Init();78 // Optional - boot whichever subsystems your game uses.9 await System.Threading.Tasks.Task.WhenAll(10 RemoteConfig.Init(),11 ABTests.Init(),12 Localization.Load()13 );1415 Analytics.TrackEvent("game_started");16 }17}KalmForgeClient.Init() is idempotent and returns a cached Task on subsequent calls. It is safe to call from any scene; you do not need a manual scene-bootstrapper.
KalmForgeSettings asset
The settings asset stores your project credentials, the active environment and per-feature opt-out flags. Both the editor window and runtime read from the same file.
| Name | Type | Description |
|---|---|---|
| ProjectId | string | Identifies your project on the dashboard. Required. |
| ActiveEnvironment | Environment | Development | Production. Selects which API key + endpoint Init() uses. |
| DevelopmentApiKey / ProductionApiKey | string | Per-environment API keys (start with kf_). |
| DevelopmentEndpoint / ProductionEndpoint | string | Override the API base URL. Defaults to https://kalmforge.com. |
| AnalyticsEnabled | bool | Set false to disable Analytics at runtime even if your plan includes it. |
| RemoteConfigEnabled, LocalizationEnabled, … | bool | One toggle per subsystem. Useful for opting out per-build (e.g. WebGL without Push). |
| ActiveApiKey | string (read-only) | Resolves to the key for ActiveEnvironment. |
| ActiveEndpoint | string (read-only) | Resolves to the endpoint for ActiveEnvironment. |
| HasAnyKey | bool (read-only) | True when at least one environment has a key configured. |
1var s = KalmForgeSettings.Load();2s.ActiveEnvironment = KalmForgeSettings.Environment.Production;3KalmForgeSettings.ClearCache(); // force the next Init() to re-readIdentity
The first time the SDK boots it generates two ids stored in PlayerPrefs:
InstallId- per-install GUID, stable across sign-outs.PlayerId- per-project GUID. IfUnity Game Services Authenticationis installed and signed-in, the SDK picks up itsPlayerIdinstead.
Override the player id when you bring your own account system:
1KalmForgeClient.SetPlayerId(myAccount.UserId);| Name | Type | Description |
|---|---|---|
| Version | string (const) | SDK version. Currently "1.0.1". |
| ProjectId | string | Project id resolved at Init time. |
| ApiKey | string | API key resolved at Init time. |
| Endpoint | string | Base URL resolved at Init time. |
| Initialized | bool | True after the first Init() resolves. |
| PlayerId / InstallId | string | Convenience accessors for KalmForgeIdentity. |
| Init() | Task | Boot the SDK using the active environment from KalmForgeSettings. |
| EnsureInitialized() | void | Fire-and-forget Init(); used by other systems internally. |
| SetPlayerId(string) | void | Bind a custom player id and persist it for this project. |
| OnInitialized | event Action | Fired once after Init resolves. |
| OnShutdown | event Action | Fired on application quit / pause-to-background. |
Lifecycle events
Hook into the client's lifecycle if you want to gate game logic on a successful boot or on shutdown:
1KalmForgeClient.OnInitialized += () => {2 Debug.Log($"[KF] booted as {KalmForgeClient.PlayerId}");3};45KalmForgeClient.OnShutdown += () => {6 // Save anything you need to persist before the process is killed.7};Environments
Switch between Development and Production by toggling ActiveEnvironment in the editor window or in code. Each environment carries its own API key, endpoint, and capability set - Remote Config and AB Tests are scoped per-environment server-side.
| Member | Description |
|---|---|
| KalmForgeSettings.Environment.Development | Default. Use during local play and QA. Logs are verbose. |
| KalmForgeSettings.Environment.Production | Use for store builds. Capability flags are stricter. |
Next steps
- Tune values without shipping a build → Remote Config.
- Run experiments → A/B Tests.
- Track gameplay → Analytics.
- Add competitive boards → Leaderboards.
- Re-engage players → Local Notifications.