This project is heavily inspired by Graham Campbell's packages; Bitbucket and GitLab.
This version supports PHP 7.2-8.2. To get started, require the project using Composer. You will also need to install packages that provide psr/http-client-implementation
and psr/http-factory-implementation
.
composer require "checkmango/php-sdk:dev-master" "guzzlehttp/guzzle:^7.2" "http-interop/http-factory-guzzle:^1.0"
composer require "checkmango/laravel:dev-master" "guzzlehttp/guzzle:^7.2" "http-interop/http-factory-guzzle:^1.0"
// Authentication
$client = new Checkmango\Client();
$client->authenticate('your_api_token');
// Example API Call
$experiment = $client->teams($teamId)->experiments()->show('EXPERIMENT_KEY');
$client->teams($teamId)->ingest()->store('EXPERIMENT_KEY', 'PARTICIPANT_KEY', 'VARIANT_KEY'); // Track impression
$client->teams($teamId)->ingest()->store('EXPERIMENT_KEY', 'PARTICIPANT_KEY', 'VARIANT_KEY', 'EVENT_KEY'); // Track conversion
The Pager
class allows you to easily retrieve all results across multiple pages of results.
$pager = new Checkmango\ResultPager($client);
$experiments = $pager->fetchAll($client->teams($teamId)->experiments(), 'all');
If you discover a security vulnerability within this package, please email James Brooks at james@checkmango.com. All security vulnerabilities will be promptly addressed. You may view our full security policy here.
Checkmango PHP SDK is licensed under The MIT License (MIT).