able
A/B testing server
Last updated 5 years ago by dannycoates .
MPL 2.0 · Original npm · Tarball · package.json
$ cnpm install able 
SYNC missed versions from official npm registry.

able A/B testing service

Roadmap

API Endpoints

Authorization is done with an oauth token from the FxA Oauth Server

GET /v1/{ app }/experiments.bundle.js

Returns a javascipt bundle for running experiments locally.

POST /v1/{ app }/variables

Returns an object mapping configuration variables to values based on currently running experiments. Only variables affected by experiments are returned therefore the result may be an empty object.

Parameters

  • subject - (optional) an object with subject attributes used by experiments
  • enrolled - (optional) an array of experiment names that this subject is enrolled in

Authorization is optional. When used the service stores which experiments the user is enrolled in, so the enrolled parameter is not required.

The user id from the oauth token is made available to experiments automatically if the request is authenticated, so it does not need to be set in the subject

Request

curl -v \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer 558f9980ad5a9c279beb52123653967342f702e84d3ab34c7f80427a6a37e2c0" \
"https://ab.accounts.firefox.com/v1/fxa_content_server/variables" \
-d '
{
  "subject": {
    "postId": 123
  },
  "enrolled": ["test1"]
}
'

Response

A json object with zero or more keys

{
  "highlyExperimentalFeatureEnabled": true,
  "fontSize": 12
}

POST /v1/{ app }/variables/{ variable }

Same as /v1/{ app }/variables but only returns the variable specified.

Request

curl -v \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer 558f9980ad5a9c279beb52123653967342f702e84d3ab34c7f80427a6a37e2c0" \
"https://ab.accounts.firefox.com/v1/foo/variables/colorScheme" \
-d '
{
  "subject": {
    "postId": 123
  },
  "enrolled": ["test1"]
}
'

Response

A json object with zero or more keys

{
  "colorScheme": "spacegray"
}

GET /v1/{ app }/attributes

Get all the subject attributes used by the current set of experiments

Request

curl -v "https://ab.accounts.firefox.com/v1/foo/attributes"

Response

An array of subject attribute names

["uid","sessionId"]

Current Tags

  • 0.4.3                                ...           latest (5 years ago)

9 Versions

  • 0.4.3                                ...           5 years ago
  • 0.4.2                                ...           5 years ago
  • 0.4.1                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 0.3.0                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.2                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 3
This Month 3
Last Day 0
Last Week 1
Last Month 1
Dependencies (13)
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |