All flags automatically enabled on dev environment? #473
-
Is there any obvious way I could use FlagsProvider or something similar, so I could always have all flags enabled in my development environment? What do you think about such a feature? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Flagged doesn't have any way to get the flags by itself, you provide them, and they could be set at build time or at runtime, they could even come from the database/an API. If you know your list of flags you can do the check yourself let isDev = process.env.NODE_ENV !== "production"
return <FlagsProvider features={{ v2: isDev || featureFromAPI}}><App /></FlagsProvider> Using a special env variables will mean the user of the lib needs to setup their build tool to replace |
Beta Was this translation helpful? Give feedback.
Flagged doesn't have any way to get the flags by itself, you provide them, and they could be set at build time or at runtime, they could even come from the database/an API.
If you know your list of flags you can do the check yourself
Using a special env variables will mean the user of the lib needs to setup their build tool to replace
process.env.FLAGGED_MAGIC_ENV
with the value fromprocess.env
at build time, not all tools do that, Create React App requires a special prefix for env variables, same with Next, Remix doesn't even do that at all.