Skip to main content


We have a composer package for Symfony PHP -

You can see the source code by the following URL:

If you need an example of step-by-step implementing A/B test you can see the example on ABRouter website

📦 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.

token: 'YOUR_TOKEN'
host: ''

🚀 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
->run('USER_ID', $buttonColorExperimentId),

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


You can get an dockerized usage example by the following link: (