How to give default values so that for whatever reason the the initialization fails, We can fallback to the default. I understand that it will default to false currently, right? If i want a feature to be true. How can i do that?
if (!useGate('my_killswitch')) {
showFeature();
}
Feature Gates are always boolean with the default value as false. If you want Feature Gates to work as a negative gate, then you can use the inverse in code.
For instance, instead of naming your gate, launch_cool_new_feature, you could name the gate, block_cool_new_feature and in code, you'd do something like this:
if (statsig.checkGate('block_cool_new_feature')) {
// Don't show new feature
} else {
// Show cool new feature
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With