- Create an Optimizely Account
- Create a ExpressJS Application
- Follow the Optimizely Node Quickstart
Requirements: Node >= 8.1 and npm >= 5.6
Requirements: Node >= 8.1 and npm >= 5.6
if (isComplex) { | |
for (var i=6, j='crazy'; i<isComplex.length; i+=3) { | |
while(j.length < 20) { | |
j = j.concat('hello'); | |
switch (i % 2) { | |
case 0: | |
j = j.concat('U'); | |
break; | |
case 1: | |
break; |
<html> | |
<head> | |
<script src="https://unpkg.com/@optimizely/optimizely-sdk@3.5/dist/optimizely.browser.umd.min.js"></script> | |
<script src="https://cdn.optimizely.com/datafiles/V7kE2tbrJaYGmtRF5W5QXf.json/tag.js"></script> | |
</head> | |
<body> | |
<h1>Hello World</h1> | |
<p id="subtitle">This is a subtitle</p> | |
</body> | |
<script> |
Requirements: Node >= 8.1 and npm >= 5.6
Note: This functionality requires an Optimizely plan with access to "Event Data Export"
The following uses the open source command line tool oevents.
oevents
bash script (any OS X and most GNU/Linux distributions)# myapp.rb | |
require 'sinatra' | |
require './optly' | |
get '/' do | |
enabled = Optly.instance.client.is_feature_enabled('hello_world', 'user123', { | |
'customerId' => 123, | |
'isVIP' => true | |
}) |
enabled = Optly.instance.client.is_feature_enabled('hello_world', 'user123', { | |
'customerId' => 123, | |
'isVIP' => true | |
}) | |
enabled ? 'Hello World! You got the hello_world feature!' : 'You did not get the hello_world feature' |
# myapp.rb | |
require 'sinatra' | |
require './optly' # Imports the Optimizely singleton | |
get '/' do | |
'Hello world!' | |
end |