Installation

Install via Composer with PSR dependencies

Source Repository: convertcom/php-sdk | Wiki | Packagist

Requirements

The SDK ships with Guzzle (guzzlehttp/guzzle ^7) as its default PSR-18 HTTP client, auto-discovered at runtime via php-http/discovery. No adapter code is required. To use a different PSR-18 client, see Swapping the PSR-18 Client below.

Install via Composer

composer require convertcom/php-sdk

This installs the SDK and its external PSR dependencies (psr/log, psr/simple-cache, php-http/discovery, and Guzzle as the default PSR-18 HTTP client).

Swapping the PSR-18 Client

Guzzle is bundled automatically — most users don't need to change anything. To use a different PSR-18 client (e.g., symfony/http-client, php-http/curl-client), remove Guzzle and install the replacement:

composer remove guzzlehttp/guzzle
composer require symfony/http-client

php-http/discovery will then pick up the new client automatically. Any PSR-18 compliant client works.

PSR Standards

StandardPackageVersionPurposeRequired
PSR-3psr/log^3.0Logging interfaceBundled
PSR-16psr/simple-cache^3.0Simple cache (config + visitor data)Bundled
PSR-17(auto-discovered)HTTP message factoriesBundled (via Guzzle by default)
PSR-18(auto-discovered)HTTP clientBundled (Guzzle by default; swappable)

Dependencies

The following packages are pulled in automatically via Composer:

PackageVersionPurpose
psr/log^3.0PSR-3 logging interface
psr/simple-cache^3.0PSR-16 simple cache interface
php-http/discovery^1.19Auto-discovers PSR-18 HTTP client and PSR-17 factories
guzzlehttp/guzzle^7.3Default PSR-18 HTTP client (see Swapping the PSR-18 Client above)

Fullstack Project Constraints

This SDK is designed for Fullstack projects (server-side A/B testing, feature flags, and feature rollouts). It supports a/b_fullstack and feature_rollout experience types with fullStackFeature variation changes only.

All entities must have a unique identifier key (a string) when defined in the Convert web interface.

Supported Experience Types

TypeDescription
a/b_fullstackA standard A/B experience
feature_rolloutAn experience with only one non-original variation

Supported Feature Variable Types

TypeDescription
booleanTrue/false
integerWhole number
stringText
jsonJSON object or array

Next Steps