Flags

Simple client side toggle flags.

Demo

The FlagSwitcher component helps toggling the flags.

Usage

import flag from 'cozy-flags'

if (flag('my-feature')) {
  enableMyFeature()
}

The FlagSwitcher shows all flags in use and displays all flags in use.

import flag, { FlagSwitcher } from 'cozy-flags'

if (process.env.NODE_ENV !== 'production'
    && flag('switcher') === undefined) {
    flag('switcher', true) // set default flag in dev mode
}

const App = () => {
  return (
    <div>
      { flag('switcher') && <FlagSwitcher /> }
      <MyApp />
    </div>
  )
}