Pokémon Feature Flags demo
When the feature flag is off, only Normal type Pokémon can be searched for in the app. When the flag is turned on, then any Pokémon can be queried!
Deploy your own
Once you've signed up for LaunchDarkly, create a feature flag. I call mine
testaroni, and you should too if you want this to work out of the box. Otherwise, you can change it in the
isAllowed function in
Pokemon.jsx. Under Flag variations, make it a String type and add an "all" type, and any other Pokémon types you'd like to include:
After that, you're all set! You can toggle it on and off in the LaunchDarkly UI, set the default rules, segment which users get which types, and more.
Click this button to deploy your own version of this project to Netlify!
You'll need to add your environment variables after cloning. Structure your
.env.local file like so (you can find your client ID under Account Settings => Projects):
...and then plop it into Netlify, and you're done!