choice-client v0.1.1
Choice Client
Simple client for Choice AB testing framework
var choice = require('choice-client')
//Call install method first
choice.install('http://your-choice-api-endpoint/choice')
//Take decision for a test. Precise test name and identifier (optional)
choice.takeDecision('test-name', 'my-unique-identifier')
//If your test succeed
choice.takeDecision('test-name', 'my-unique-identifier')
Quick Start
choice-client is an ultra simple client communicating with Choice API. Before starting, make sure you have an available and running choice API.
- Start by initializing your client:
choice.install('http://your-choice-endpoint/choice')
- You can use available methods :
takeDecision
ortrackConversion
Documentation
install(url)
Init choice-client with Choice API endpoint.
takeDecision(testName, uuid)
Ask Choice to take a decision for a given test. You will receive in return a uuid (auto generated
if you do not provide one), and the options object containing the selected label. For future
requests made by the same user, make sure to store the generated uuid, and to include this uuid
in all future calls to takeDecision
. Choice will remember its past choices and return the same
selected value for the same user.
trackConversion(testName, uuid)
Track a conversion for a given test and user. This will record that this option for this user has been a success.