https://github.com/invrs/variate
Client-side multivariate testing
https://github.com/invrs/variate
Last synced: about 3 hours ago
JSON representation
Client-side multivariate testing
- Host: GitHub
- URL: https://github.com/invrs/variate
- Owner: invrs
- Created: 2016-01-11T20:11:28.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-18T20:11:11.000Z (almost 10 years ago)
- Last Synced: 2024-10-10T00:04:32.734Z (almost 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 12
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Variate [](https://travis-ci.org/invrs/variate)
Client-side multivariate testing.
## Install
```bash
npm install variate
```
## Usage
Variate uses the [industry factory pattern](https://github.com/invrs/industry):
```js
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" })
```