Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

FDMediagroep/fdmg-ts-react-ab

Repository files navigation

DEPRECATED ❗ : Superseded by @fdmg/design-system. See: https://github.com/FDMediagroep/fd-design-system

Build Status All Contributors Coverage Status npm version

fdmg-ab

A/B testing component

Demo

Installation

  • Run npm i -D @fdmg/ab

Usage

import { Experiment, Variant, ABProvider } from "@fdmg/ab";
...
    <ABProvider>
...
        <Experiment
            name="Globally unique experiment name"
            debugUriParam="ABdebug=true"
            onClick={console.log}
            onRunExperiment={console.log}
        >
            <Variant name="A" onClick={console.log}>
                <h1>Headline 1</h1>
            </Variant>
            <Variant name="B" onClick={console.log}>
                <h1>Headline 2</h1>
            </Variant>
        </Experiment>
...
    </ABProvider>
...

ABProvider component provides a context which manages cookies. The cookies are used to store variants shown to the user so subsequent visits show the same variants for that user.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Willem Liu
Willem Liu

💻 📖 💡 🚧
Willem Liu
Willem Liu

💻 📖 💡 🚧
Greenkeeper
Greenkeeper

💻

This project follows the all-contributors specification. Contributions of any kind welcome!