@evolv-delivery/utils
v1.1.0
Published
A library of helper functions for writing experiments
Downloads
4
Keywords
Readme
Evolv Utils
A library of helper functions for writing experiments
Installation
Add as an integration via NPM to your environment. The library will be added to the evolv
window object. Most methods can be accessed directly from the window.evolv.utils
object, however sandboxing is recommended to prevent collisions with other running experiments and to unlock the describe
method.
Utilization
Initialize in the context of your experiment.
const config = {
name: 'New Experiment',
version: '1.0.0',
contexts: [
{
id: 'homepage',
display_name: 'Home',
variables: [
{
id: 'c1',
display_name: 'C1: Change header copy',
variants: [
{
id: 'v0'
display_name: 'C1V0: Control'
},
{
id: 'v1',
display_name: 'C1V1: "The best there is"'
},
{
id: 'v2',
display_name: 'C1V2: "The best that ever was"'
}
]
}
]
}
]
}
const utils = window.evolv.utils.init('home', config);
const { log, describe } = utils;
log('init:', config.name, config.version);
describe('homepage');
API
For API documentation refer to Utils API