ablab sample - cjs

node v14.20.1
version: master
endpointsharetweet
const experimentConfig = { "changing the button color": { "variations": { "treatment": { "traffic": 50, "data": { "color": "yellow", "textColor": "black" } }, "control": { "traffic": 50, "data": { "color": "blue", "textColor": "white" } } } }, "make the animation slower": { "variations": { "treatment": { "traffic": 50, "data": { "speed": 2 } }, "control": { "traffic": 50, "data": { "speed": 0.5 } } } }, "change the copy/text": { "variations": { "a": 33.33, "b": 33.33, "c": 33.33 } }, // Represents an experiment that was successful // and would later need to be cleaned up/promoted in code "shipped flight/experiment": { "variations": { "treatment": 100, "control": 0 } } };
const ablab = require("ablab"); const experimenter = ablab.createExperimenter(experimentConfig); const uniqueIdVariations = experimenter.getVariationsForUniqueId(''); console.log(uniqueIdVariations);
Loading…

no comments

    sign in to comment