# able

> A/B testing server

Latest version **0.4.3** (published 2015-08-24) · MPL 2.0 license · 0 weekly downloads

## Install

```sh
npm install able
pnpm add able
yarn add able
bun add able
```

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.3 |
| Published | 2015-08-24 |
| First published | 2015-01-10 |
| Weekly downloads | 0 |
| License | MPL 2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 13 |
| Known vulnerabilities | 0 (+10 in 3 direct dependencies) |
| Install scripts | yes |
| Maintainers | dannycoates |

## Links

- npm: https://www.npmjs.com/package/able
- npm.io page: https://npm.io/package/able

## Dependencies (13)

- [xhr](https://npm.io/package/xhr.md) 2.0.1
- [boom](https://npm.io/package/boom.md) 2.6.1
- [glob](https://npm.io/package/glob.md) 5.0.5
- [hapi](https://npm.io/package/hapi.md) 8.4.0
- [async](https://npm.io/package/async.md) 0.9.0
- [abatar](https://npm.io/package/abatar.md) 0.4.1
- [mozlog](https://npm.io/package/mozlog.md) 2.0.0
- [convict](https://npm.io/package/convict.md) 0.6.1
- [inherits](https://npm.io/package/inherits.md) 2.0.1
- [uglify-js](https://npm.io/package/uglify-js.md) 2.4.24
- [browserify](https://npm.io/package/browserify.md) 9.0.8
- [hapi-fxa-oauth](https://npm.io/package/hapi-fxa-oauth.md) 2.0.1
- [github-url-to-object](https://npm.io/package/github-url-to-object.md) git://github.com/vladikoff/github-url-to-object.git#clone_url

## Recent versions

- 0.4.3 (latest) — 2015-08-24
- 0.4.2 — 2015-07-12
- 0.4.1 — 2015-04-27
- 0.4.0 — 2015-04-26
- 0.3.0 — 2015-04-15
- 0.2.0 — 2015-03-11
- 0.1.2 — 2015-03-11
- 0.1.1 — 2015-03-11
- 0.1.0 — 2015-01-10

## README

able A/B testing service
========================

[Roadmap](doc/roadmap.md)

# API Endpoints

Authorization is done with an oauth token from the [FxA Oauth Server](https://github.com/mozilla/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

```sh
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

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

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

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

### Request

```sh
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

```json
{
  "colorScheme": "spacegray"
}
```

## GET /v1/{ app }/attributes

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

### Request

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

### Response

An array of subject attribute names

```json
["uid","sessionId"]
```

---
_Source: https://npm.io/package/able · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
