https://www.growthbook.io/ logo
#announcements
Title
# announcements
h

helpful-hydrogen-62495

01/30/2022, 9:31 PM
hey guys, any pros/cons to using the env-specific API keys vs. feeding the env the user is on client side as an attribute and then making an override rule based on that?
f

fresh-football-47124

01/30/2022, 9:36 PM
Pro of env specific API keys are that you can test out flags that have complex rules on dev/staging and then turn it on on production easily without further changes. If you use the env attribute, when you deploy to production, you have to edit the rule, or have multiple copies of the flag for each environment. If you have complex override rules, using env attributes become harder to work with.
f

future-teacher-7046

01/31/2022, 12:31 AM
I would always use the env-scoped API keys. On top of that, an env attribute can also be useful for advanced use cases, for example if you want to test a new rule for a feature that is already live in production.
h

helpful-hydrogen-62495

01/31/2022, 2:56 AM
Appreciate the thoughts guys, I’ll switch over to the new API keys then
15 Views