Giter Site home page Giter Site logo

pokemon-feature-flags's Introduction

Pokémon Feature Flags demo

Netlify Status

Here's a demo for integrating feature flags into a React project! Built with React, Vite, the PokeAPI, and LaunchDarkly!

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

LaunchDarkly setup

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:

image

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.

Netlify setup

Click this button to deploy your own version of this project to Netlify!

Deploy 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):

VITE_LD_CLIENT_KEY=your_key

...and then plop it into Netlify, and you're done!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.