Feature Flag handling in aws / amplify?

Viewed 973

I'm very new into aws amplify and want to know if there is any mechanism of feature flag handling or remote controlling variables? for sure I could send any messages, receive them on the device and do whatever I like, but I'm sure there must be some other way like in Google Firbease Remote Config. But as far as I could read the tools of aws/amplify see there is a lot of overhead just to configure a feature-flag on remote in aws.

1 Answers

I would look to a hosted tool, one that is simple. https://www.featureflow.com has worked great for us and is very simple to integrate. e.g. in react https://www.npmjs.com/package/react-featureflow-client :

import { useFeatureflow, useFeatures } from 'react-featureflow-client'

const App: React.FC<Props> = () => {

  const featureflow = useFeatureflow();
  const features = useFeatures();
  const feature = 'example-feature';

  return  <div>
    <h1>A very simple example</h1>
    <b>{feature}</b>
    { featureflow.evaluate(feature).isOn() && [
        <p key="1">I am on</p>,
    ]}
    { featureflow.evaluate(feature).isOff() && [
      <p key="1">I am off</p>,
      ]
    }
    {Object.keys(features).map(key => <div>{key} : {features[key]}</div>)}
  </div>
}

or plain js: https://github.com/featureflow/featureflow-javascript-sdk

var FF_JS_API_KEY = '<Your javascript api key goes here>';
//...
var featureflow = Featureflow.init(FF_JS_API_KEY);
if(featureflow.evaluate('my-feature-key').isOn()){
  // this feature code will be run because 'my-feature-key' is set to 'on'
}
Related