https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
g

great-lock-96795

02/21/2023, 11:18 PM
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

future-teacher-7046

02/21/2023, 11:34 PM
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

great-lock-96795

02/21/2023, 11:35 PM
So it just for on off features
f

future-teacher-7046

02/21/2023, 11:37 PM
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

great-lock-96795

02/21/2023, 11:38 PM
Ok
Thanks
Is there some way to add new features flags?
f

future-teacher-7046

02/21/2023, 11:40 PM
Only via the GrowthBook UI at the moment
g

great-lock-96795

02/21/2023, 11:40 PM
Ok
Are you planning to add this features in the close future?
25 Views