Skip to content

v1.3.0 - Adds overrideGate and overrideConfig APIs, improves ID list implementation

Compare
Choose a tag to compare
@tore-statsig tore-statsig released this 30 Mar 18:42
· 277 commits to main since this release

Introduces overrides, which are useful for testing.

func OverrideGate(gate string, val bool)

func OverrideConfig(config string, val map[string]interface{})

We recommend using this, in combination with the LocalMode option in StatsigOptions to force gate/config values in test environments and remove network access to statsig servers.

e.g.

c := NewClientWithOptions(secret, &Options{LocalMode: true})

user := User{
    UserID: "123",
}
gateDefault := c.CheckGate(user, "any_gate")
// "any_gate" is false by default

c.OverrideGate("any_gate", true)
// "any_gate" is now true

Also introduces a more performant ID list implementation