Download the PHP package checkmango/php-sdk without Composer
On this page you can find all versions of the php package checkmango/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download checkmango/php-sdk
More information about checkmango/php-sdk
Files in checkmango/php-sdk
Package php-sdk
Short Description The PHP SDK for Checkmango
License MIT
Homepage https://github.com/checkmango/php-sdk
Informations about the package php-sdk
Checkmango PHP SDK
This project is heavily inspired by Graham Campbell's packages; Bitbucket and GitLab.
Installation
This package requires PHP 7.3 or PHP 8.x. 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.
Standard Installation
Laravel Installation
Usage
Organization IDs are numeric; experiments, variants, events, features, and participants are addressed by their keys. Ingestion is asynchronous: a successful request returns an empty array after the API accepts it with HTTP 202. Select a variant before ingesting; the experiment must be running.
Organizations and account
Experiments, events, and variants
These resources also provide list, show, update, and remove. Pass query options such as include, filter, sort, and per_page in the parameter array for reads. Experiment statistics are available once analysis has produced a result.
Feature flags
Feature values support text format. Organization config includes feature values and features_revision. To revalidate cached config, supply If-None-Match to config([], ['If-None-Match' => $etag]). Read the ETag and status through $client->getLastResponse(); a 304 returns an empty array, so retain your cached config.
Participants and attributes
Participant resources expose blocked and blocked_at in their attributes. The SDK returns JSON:API data as arrays, preserving resource attributes and relationships. Validation exceptions expose field messages through $exception->errors.
Example with Pager
ResultPager retrieves results across multiple pages using the API's per_page parameter.
Migrating existing integrations
- Use
organizations($organizationId)to access organization resources through/api/organizations. The former team-named methods and classes have been removed. - Existing
create($key, $params)calls for events and experiments now POST to the collection URL withkeyin the body. - Prefer
ingest()->store(...)for enrollment and impressions. The legacy experimentenrol/enrollhelpers require['variant' => 'VARIANT_KEY']; participant experimentcreaterequires['experiment' => 'EXPERIMENT_KEY', 'variant' => 'VARIANT_KEY']. These helpers now use ingestion and return an empty array on HTTP 202. Variantimpressionalso uses ingestion. Additional parameters on these legacy helpers are not forwarded. - Use
listas the method name withResultPager; there is noallmethod.
Security
If you discover a security vulnerability within this package, please email James Brooks at [email protected]. All security vulnerabilities will be promptly addressed. You may view our full security policy here.
License
Checkmango PHP SDK is licensed under The MIT License (MIT).
All versions of php-sdk with dependencies
ext-json Version *
php-http/cache-plugin Version ^1.7.1
php-http/client-common Version ^2.3
php-http/discovery Version ^1.12
php-http/httplug Version ^2.2
php-http/multipart-stream-builder Version ^1.1.2
psr/cache Version ^1.0
psr/http-client-implementation Version ^1.0
psr/http-factory-implementation Version ^1.0
psr/http-message Version ^1.0
symfony/polyfill-php80 Version ^1.17