Flagsmith for Unity

Setup

Add FlagsmithBehaviour to a GameObject that lives for the whole session (your bootstrap scene, or call DontDestroyOnLoad on it). Inspector fields:

Field Default Notes
Environment Key The client-side key from the environment's SDK keys page
Api Url https://edge.api.flagsmith.com/api/v1/ Self-hosted: http://your-host:8000/api/v1/
Events Url empty Empty sends events to Flagsmith Cloud's events API, or to <Api Url>events/ when self-hosted
Retry Delay Seconds 1 Wait before the single retry of a failed request (real time, so a paused game still retries)
Identifier empty Empty generates a random ID once and keeps it in PlayerPrefs
Refresh Seconds 60 0 fetches once at startup. 1-2 while tuning
Flush Seconds 10 How often queued events are sent

To configure from code instead, add the component and call Init straight away:

var flagsmith = gameObject.AddComponent<FlagsmithBehaviour>();
flagsmith.Init(new FlagsmithOptions { EnvironmentKey = "your-client-key" }, id: accountId, refresh: 60f);

The first fetch starts as soon as the component starts. Until it returns, Flags is empty and every read returns your fallback, so always pass a sensible default.