Laboratory
Simple A/B Testing Framework for both client and server environments.
Laboratory chooses a variant for each experiment based on a configurable probability. Use the pluggable storage interface to serve users a consistent experience after they've been assigned a variant.
$ npm install laboratory
Example Usage
Run a single Experiment:
require "laboratory"experiment = "color"variant "red"50"#FF0000"variant "blue"50"#0000FF"variant = experimentrunvariantname # Either red or bluevariantvalue # Either FF0000 or 0000FF
Run a suite of experiments in a Laboratory:
require "laboratory"laboratory = laboratoryaddExperiment"color" variant "red"50"#FF0000" variant "blue"50"#0000FF" laboratoryaddExperiment"FuzzyBunnies" variant "variant0"50 name: "Peter Rabbit" type: "Wooly" variant "variant1"50 subject: "Briar Rabbit" type: "Silky" experiment = laboratoryrun"FuzzyBunnies"experimentvalue # Either Peter or Briar Rabbit
Store the results per user in browser local storage:
store = # not includedlaboratory = storelaboratoryaddExperiment /* ... */laboratoryrun /* ... */