ConfigCat PHP SDK
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

ConfigCat SDK for PHP

ConfigCat SDK for PHP provides easy integration between ConfigCat service and applications using PHP.

ConfigCat is a feature flag, feature toggle, and configuration management service. That lets you launch new features and change your software configuration remotely without actually (re)deploying code. ConfigCat even helps you do controlled roll-outs like canary releases and blue-green deployments.

Build Status Coverage Status Latest Stable Version Total Downloads Latest Unstable Version

Getting started

1. Install the package with Composer

composer require configcat/configcat-client

2. Log in to ConfigCat Management Console and go to your Project to get your API Key:


4. Create the ConfigCat client instance

$client = new \ConfigCat\ConfigCatClient("#YOUR-API-KEY#");

5. Get your setting value:

$isMyAwesomeFeatureEnabled = $client->getValue("isMyAwesomeFeatureEnabled", false);
if(is_bool($isMyAwesomeFeatureEnabled) && $isMyAwesomeFeatureEnabled) {
} else {

Getting user specific setting values with Targeting

Using this feature, you will be able to get different setting values for different users in your application by passing a User Object to the getValue() function.

Read more about Targeting here.

User object

Percentage and targeted rollouts are calculated by the user object you can optionally pass to the configuration requests. The user object must be created with a mandatory identifier parameter which should uniquely identify each user:

$user = new \ConfigCat\User("#USER-IDENTIFIER#"); // mandatory

$isMyAwesomeFeatureEnabled = $client->getValue("isMyAwesomeFeatureEnabled", false, $user);
if(is_bool($isMyAwesomeFeatureEnabled) && $isMyAwesomeFeatureEnabled) {
} else {


If you need help how to use this SDK feel free to to contact the ConfigCat Staff on We're happy to help.


Contributions are welcome.

About ConfigCat