Hey are you planning to include a way of updating ...
# ask-questions
g
Hey are you planning to include a way of updating the value of a feature flag in the sdk for JavaScript? Something like:
gb.updateFeatureFlag('feature-flag-key', true);
I need to change the values of the feature flags from outside the Growthbook ui. Is there a way of doing this?
f
We do have a REST endpoint to toggle feature flag states - https://docs.growthbook.io/app/api#toggle-feature
Right now, it only lets you control the top-level environment toggles. In the future, we plan to add support to let you modify rules and other properties of the feature flag
g
So it just for on off features
f
it's for any feature type, but it's just for the kill switches. All features have top-level toggles for each environment that determines if it's included in the API response or not. And then, if it is included, the feature has a default value, which could be a boolean, string, etc..
Setting the toggle with that REST endpoint to "off", will basically make the feature value
null
. Setting it to "on", will make it use the default value defined in the GrowthBook UI
g
Ok
Thanks
Is there some way to add new features flags?
f
Only via the GrowthBook UI at the moment
g
Ok
Are you planning to add this features in the close future?