Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

variate

2.4.0 • Public • Published

Variate Build Status

Client-side multivariate testing.

Install

npm install variate

Usage

Variate uses the industry factory pattern:

import variate from "variate"
 
variate({
  cookie: {
    expires: 10 * 365,
    path:    "/",
    domain:  "site.com",
    secure:  true
  },
  tests: {
    banner: [ "short", "tall" ]
  },
  callback: ({ name, test, variant, converted }) => {
    // name - "banner"
    // test - [ "short", "tall" ]
    // variant - "short" or "tall"
    // converted - true or false
  }
})
 
// returns "short" or "tall"
//
variate().test({ name: "banner" })
 
// record conversion
//
variate().convert({ name: "banner" })

Keywords

none

Install

npm i variate

DownloadsWeekly Downloads

0

Version

2.4.0

License

MIT

Last publish

Collaborators

  • avatar