Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asaschachar/1ef7112747e55f7c88bf9cb9089949cd to your computer and use it in GitHub Desktop.
Save asaschachar/1ef7112747e55f7c88bf9cb9089949cd to your computer and use it in GitHub Desktop.
app.get('/', function(req, res, next) {
const isEnabled = req.optimizely.client.isFeatureEnabled(
'hello_world', // Feature key connecting feature to UI
'user123', // String ID used for random percentage-based rollout
{
customerId: 123, // Attributes used for targeted audience-based rollout
isVip: true,
}
);
res.send('Optimizely Express Example: ' + (isEnabled ? 'You got the hello world feature!' : 'Feature off.'))
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment