Hey I want to set forced value for my feature usin...
# ask-questions
m
Hey I want to set forced value for my feature using the sdk, how can I do it? Thanks. I found this ref in the docs: https://docs.growthbook.io/lib/js Still not clear about the implementation.
w
Hi Punit, I'm not sure if I fully understand. You set up a force rule within the UI from /features/<YOUR FATURE NAME>. The forced rule will be checking whether the user has been assigned an attribute where the value matches some sort of pattern. You can set the attribute values like you can see in the link you sent when setting up
new Growthbook({attributes:{...},...)
m
I want to create a force rule from the sdk instead of the UI.
w
I see. Then what you are probably looking for is not the SDK but the growthbook API: https://docs.growthbook.io/api/#tag/features. The SDK is used to integrate your app for the general user. It sounds like you want to make some sort of admin ability within your app.
Unfortunately I don't see a full post for feature rules as part of the API yet. Doing that is probably part of the roadmap.
👍 1