scale-jobs / abfy.io

World's simplest A/B testing Library
3 stars 1 forks source link

ABfy: A Lightweight A/B Testing Library for React

ABfy is a simple yet powerful A/B testing library designed to make experimentation easy within your React applications. It provides intuitive components and utilities to help you define, track, and analyze A/B tests to optimize your user experience and drive better results.

To checkout the mental model behind ABfy Read this

Checkout the experiment data format and publishing

Features

Installation

npm install abfy
# or
yarn add abfy

Usage

import { ABfyProvider, Experiment, Variant, KeyAction } from "abfy";

function MyComponent() {
  return (
    <ABfyProvider backendUrl="https://your-backend-endpoint">
      <Experiment id="my-experiment">
        <Variant id="control">
          <button>Original Button</button>
        </Variant>
        <Variant id="variation">
          <button>New Button</button>
        </Variant>
      </Experiment>

      {/* Track user interactions within the experiment */}
      <KeyAction onClick={() => /* ... */}>
        Track this click!
      </KeyAction>
    </ABfyProvider>
  );
}

Components

Advanced Usage

Contributing

Contributions are welcome! Please feel free to open issues or submit pull requests.

License

ABfy is open-source software licensed under the MIT License.