Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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