-
Notifications
You must be signed in to change notification settings - Fork 1
Installation
Source Repository: convertcom/php-sdk | Wiki | Packagist
-
PHP
^8.2— tested in CI against 8.2, 8.3, and 8.4, on both--prefer-lowestand--prefer-stabledependency resolutions - The
curl,json, andmbstringextensions - A Convert Experiences account with an SDK key
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.
composer require convertcom/php-sdkconvertcom/php-sdk is a single package. The repository is a monorepo internally, but everything the SDK needs — every ConvertSdk\* namespace and the generated OpenAPI\Client types — ships inside this one Composer package. There are no convertcom/php-sdk-* sub-packages to install.
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-clientphp-http/discovery will then pick up the new client automatically. Any PSR-18 compliant client works.
| Standard | Interface package | Purpose | Implementation |
|---|---|---|---|
| PSR-3 | psr/log ^3.0 |
Logging interface | Yours — pass PSR-3 loggers via logger.customLoggers
|
| PSR-16 | psr/simple-cache ^3.0 |
Simple cache (config + visitor data) | Defaults to the in-memory ArrayCache; pass your own for persistence |
| PSR-17 | psr/http-factory ^1.0 |
HTTP message factories | Auto-discovered (Guzzle by default) |
| PSR-18 | psr/http-client ^1.0 |
HTTP client | Auto-discovered (Guzzle by default; swappable) |
The following packages are pulled in automatically via Composer:
| Package | Version | Purpose |
|---|---|---|
psr/log |
^3.0 |
PSR-3 logging interface |
psr/simple-cache |
^3.0 |
PSR-16 simple cache interface |
psr/http-client |
^1.0 |
PSR-18 HTTP client interface |
psr/http-factory |
^1.0 |
PSR-17 message factory interfaces |
psr/http-message |
^1.1 || ^2.0 |
PSR-7 HTTP message interfaces |
php-http/discovery |
^1.19 |
Auto-discovers the PSR-18 HTTP client and PSR-17 factories |
lastguest/murmurhash |
^2.1 |
MurmurHash3 — the bucketing hash shared with every other Convert SDK |
guzzlehttp/guzzle |
^7.3 |
Default PSR-18 HTTP client (see Swapping the PSR-18 Client above) |
guzzlehttp/psr7 |
^1.7 || ^2.0 |
PSR-7 message implementation used by Guzzle |
Plus the ext-curl, ext-json, and ext-mbstring PHP extensions.
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.
| Type | Description |
|---|---|
a/b_fullstack |
A standard A/B experience |
feature_rollout |
An experience with only one non-original variation |
| Type | Description |
|---|---|
boolean |
True/false |
integer |
Whole number |
string |
Text |
json |
JSON object or array |
- Initialization — SDK Key vs. static config
- Configuration — Full config options reference
Copyrights © 2026 All Rights Reserved by Convert Insights, Inc.
Getting Started
PHP SDK
- Quickstart
- Installation
- Initialization
- Configuration
- Return Types & DTOs
- Code Examples
- Segments Manager
Core Concepts
- Experiences & Variations
- Feature Flags
- Bucketing Algorithm
- Rule Evaluation
- Segments
- Data Management
- Event System
- API Communication
How-To Guides
- Running Experiences
- Running Features
- Tracking Conversions
- Visitor Context
- Persistent DataStore
- Troubleshooting
- Direct Tracking Endpoint
- Server-Side Experimentation
- From Tracking Script to SDK
- QA & Preview
- Mutually Exclusive Experiments
- Split URL Tests
Contributing