-
Notifications
You must be signed in to change notification settings - Fork 1
Installation
Source Repository: convertcom/php-sdk | Wiki | Packagist
- PHP 8.2, 8.3, or 8.4
- A PSR-18 HTTP client (e.g.,
guzzlehttp/guzzle ^7) - A Convert Experiences account with an SDK key
The SDK auto-discovers your PSR-18 client via php-http/discovery. Install any compliant client — no adapter code needed.
composer require convertcom/php-sdkThis installs the SDK and all internal packages.
You must also install a PSR-18 HTTP client. For example:
composer require guzzlehttp/guzzleAny PSR-18 compliant client works (e.g., symfony/http-client, php-http/curl-client).
| Standard | Package | Version | Purpose | Required |
|---|---|---|---|---|
| PSR-3 | psr/log |
^3.0 |
Logging interface | Bundled (installed automatically) |
| PSR-16 | psr/simple-cache |
^3.0 |
Simple cache (config + visitor data) | Bundled (installed automatically) |
| PSR-17 | (auto-discovered) | — | HTTP message factories | User must install one |
| PSR-18 | (auto-discovered) | — | HTTP client | User must install one |
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 |
php-http/discovery |
^1.19 |
Auto-discovers PSR-18 HTTP client and PSR-17 factories |
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
Contributing