Skip to content

Flagsmith for Unity 0.1.0

Latest

Choose a tag to compare

@Harindulk Harindulk released this 27 Nov 12:00
· 16 commits to main since this release
87b8818

First release of Flagsmith for Unity: feature flags, remote config, live tuning and A/B tests for Unity games, powered by Flagsmith. Community package, MIT licensed. It is not an official Flagsmith SDK.

Install

Unity 6 (6000.0) or newer. In Window > Package Manager > + > Install package from git URL:

https://github.com/Harindulk/flagsmith-unity.git?path=/com.flagsmith.unity#v0.1.0

Or download com.flagsmith.unity-0.1.0.tgz below and choose Install package from tarball.

What's in it

  • FlagsmithClient: environment and identity flags with traits, typed GetValue<T>, one retry on network errors and HTTP 5xx.
  • FlagsmithBehaviour: a persistent player identity, background refresh, a FlagsChanged event, and automatic event flushing.
  • [FlagsmithValue] and Bind: fields and properties that follow their flags.
  • Experimentation: GetExperimentFlag records an exposure for enrolled players, and TrackEvent records the metric. Events are batched, sent once per session, saved to disk on pause and retried after network failures.
  • Offline support: the last good flags are cached on disk.
  • An Editor window (Window > Flagsmith) to list, toggle and edit flags.
  • WebGL support: everything runs on Unity's main thread with UnityWebRequest.
  • The client refuses server-side environment keys.

Tested

26 automated tests in the Unity Editor, one of them against self-hosted Flagsmith 2.295.2. WebGL builds in Chrome and the Safari engine. An Android IL2CPP build on an emulator. iOS and desktop players, and Experimentation on Flagsmith Cloud, are not tested yet.

Docs · Play the demo in your browser