abrouter / symfony-abtest

ABRouter Symfony AB test is a simple package for the base library to run ab-tests and feature flags via ABRouter with Laravel. Prepare and run your ab-test in 10 minutes. Easy to manage and run. Can be also used as a feature flag or feature toggle. Free cloud version available for free. Completely open-source.

Home Page:https://abrouter.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ABRouter Symfony A/B Tests | Split Tests

ABRouter AB Test πŸ‘·β€β™€οΈ is a simple package for base library to run A/B tests via ABRouter with Symfony. You can find base PHP library in https://github.com/abrouter/abrouter-php-client

You're welcome to visit the docs.

What is the ABRouter service ?

ABRouter is the service to manage experiments(A/B split tests). The service provides easy to manage dashboard to keep experiments under control. There you can create experiments, branches and set a percentage for every branch. Then, when you're running an ab-test on PHP you will receive a perfect branch-wise response that following the rules, that you set up.

Can be also used as a feature flag or feature toggle. Available for free.

Prepare your first A/B test

Besides of the installing this package you need to have an account on ABRouter. Your token and experiment id will be also there.

πŸ“¦ Install

Via composer

$ composer require abrouter/symfony-abtest

Register the bundle

Register bundle

// config/bundles.php
return [
    // [...]
    Abrouter\SymfonyClient\AbrouterClientBundle::class => ['all' => true],
];

Configure ABRouter client:

Put your ABRouter token in /config/packages/abrouter_client.yaml. You can find this token in ABRouter dashboard.

abrouter_client:
  token:                'YOUR_TOKEN'
  host:                 'https://abrouter.com'

πŸš€ Usage

use Abrouter\Client\Client;

class ExampleController
{
    public function __invoke(Client $client)
    {
        $buttonColorExperimentId = 'D1D06000-0000-0000-00005030';
        return new Response(json_encode([
            'button_color' => $client
                ->experiments()
                ->run('USER_ID', $buttonColorExperimentId),
        ]));
    }
}

You can create an experiment and get your token and id of experiment on ABRouter or just read the docs.

Example

You can get an dockerized usage example by the following link: (https://github.com/abrouter/symfony-abtest-example)

πŸ”§ Contributing

Please feel free to fork and sending Pull Requests. This project follows Semantic Versioning 2 and PSR-2.

πŸ“„ License

GPL3. Please see License File for more information.

About

ABRouter Symfony AB test is a simple package for the base library to run ab-tests and feature flags via ABRouter with Laravel. Prepare and run your ab-test in 10 minutes. Easy to manage and run. Can be also used as a feature flag or feature toggle. Free cloud version available for free. Completely open-source.

https://abrouter.com

License:MIT License


Languages

Language:PHP 100.0%