Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@appannie/ab-testing

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appannie/ab-testing

AB testing library supporting multi-variance testing with a deterministic algorithm not requiring any complex backend or database.

  • 1.1.0
  • npm
  • Socket score

Version published
Weekly downloads
74
decreased by-38.84%
Maintainers
4
Weekly downloads
 
Created
Source

AB Testing

AB testing library supporting multi-variance testing with a deterministic algorithm not requiring any complex backend or database.

The segmentation logic is maintained in the AB testing client and based itself on a centralized configuration. The cohort assignment logic is deterministic and follows a simple hash pattern based on the crc32c algorithm (crc32c(userId, crc32c(experimentName)) % 100)

Installation

npm install @appannie/ab-testing
# or
yarn add @appannie/ab-testing

Usage

Note: The configuration file format is documented here.

import { Experiments } from '@appannie/ab-testing';

const profile = {
    persona: user.persona,
    employee: user.isEmployee,
};

const experiments = new Experiments(config, user.id, profile);
const cohort = experiments.getCohort('experiment-name');

switch (cohort) {
    case 'blue':
        console.log('user in the blue cohort');
        break;
    case 'red':
        console.log('user in the red cohort');
        break;
    // 'control' is the default cohort. All experiments have a control cohort.
    case 'control':
    default:
        console.log('user in the control (default) cohort');
        break;
}

Credits

Made with ❤️ by Zhang Tao and Simon Boudrias from the App Annie Beijing office.

Available for public use under the MIT license.

FAQs

Package last updated on 11 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc