New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ab-positive

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ab-positive

A lightweight, approachable A/B testing component for React.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

status npm donwloads issues license

AB+

A lightweight, flexible A/B testing component for React.

The goal of this project is to provide an approachable, functional split testing setup for React apps with minimal implementation overhead. AB+ exposes key callbacks for handling experiments and reporting on variants, which can be used for things like transmitting analytics events and performing further rendering operations.

AB+ uses localStorage to keep track of rendered variants so that a user will continue to see the same variant once it has been chosen.

Please note: this project is a work-in-progress. Feedback & contribution is greatly welcomed!

Installation

Via NPM
npm install --save ab-positive

Usage

Basic example usage
import React from 'react';
import { BannerA, BannerB } from '../components';
import { Experiment, Variant } from 'ab-positive';

...

<Experiment name="homepage_banner" />
  <Variant name="plain" component={BannerA} />
  <Variant name="bold" component={BannerB} />
</Experiment>

Experiment

An experiment manages a set of variants and dictates which variant is ultimately rendered.

You can use as many variants within an experiment as desired.

| prop (required) | type | description | |--------|-----------|------|-------------| | name | String | a name for the experiment being run |

Variant

A variant provides a wrapped instance of your component which allows for props to be injected.

| prop (required) | type | description | |--------|-----------|------|-------------| | name | String | a name for the variant | | component* | React component | the component to load within the variant |

Testing

npm test

Troubleshooting

WIP

License

MIT [LICENSE.md]

Contributors

  • Adam Sidiali [Gh] [Tw]

Keywords

react

FAQs

Package last updated on 02 Jan 2017

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