Hello. how growthbook know which current environme...
# announcements
r
Hello. how growthbook know which current environment (dev or prod) is using? we are using react native and we want to enable feature only in development. do i need to create a sdk connections that have development environment?
w
Yes, you need to specify the environment when you create the sdk key. You can then choose which envs a feature shows up on with a toggle on the feature page, or the feature overview page. https://docs.growthbook.io/app/features#environments
r
hi @white-fireman-22476 already did that. but when i call the useFeatureIsOn() it is always false even i enabled it
Screenshot 2023-07-31 at 5.13.00 PM.png
w
Do you have the Growthbook Devtools chrome extension? That can help debug what is going on: https://chrome.google.com/webstore/detail/growthbook-devtools/opemhndcehfgipokneipaafbglcecjia
r
i am using react native. does it work?
w
ah
In that case, what are your override rules?
r
i dont have any override rules
Screenshot 2023-07-31 at 5.21.08 PM.png
w
You have a default value of off
so I would expect it would be off for everyone
r
i see. but if i enabled it it will always be true?
w
correct
in general you probably want to leave it as false but provide override rules for who you want to see the feature
r
i see. so to change its value i need to change the default value not the enabled environments toggle?
w
Well the env toggle needs to be on to serve the rule to that environment.
👍 1
Then the feature will always return the default value unless overwritten by the overwrite rules
r
my usecase is to enable the feature in an environment. e.g (enable in dev, disabled in prod)
w
Well one way could be to set the default to true, but disable the prod env var. The other way is to keep default to false, then create an override rule in dev with a 100% rollout percentage.
r
alright. got it. thank you so much, @white-fireman-22476
w
Sure thing. I hope Growthbook works well for you and feel free to give us any feedback or ask any other questions here.
🫡 1