PHPackages                             configcat/configcat-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. configcat/configcat-client

ActiveLibrary[API Development](/categories/api)

configcat/configcat-client
==========================

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.

v9.2.1(3mo ago)221.1M↓14.3%115MITPHPPHP &gt;=8.1CI passing

Since Jan 8Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/configcat/php-sdk)[ Packagist](https://packagist.org/packages/configcat/configcat-client)[ Docs](https://github.com/configcat/php-sdk)[ RSS](/packages/configcat-configcat-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (41)Used By (5)

ConfigCat SDK for PHP
=====================

[](#configcat-sdk-for-php)

ConfigCat SDK for PHP provides easy integration for your application to ConfigCat.

ConfigCat is a feature flag and configuration management service that lets you separate releases from deployments. You can turn your features ON/OFF using [ConfigCat Dashboard](https://app.configcat.com) even after they are deployed. ConfigCat lets you target specific groups of users based on region, email or any other custom user attribute.

ConfigCat is a [hosted feature flag service](https://configcat.com). Manage feature toggles across frontend, backend, mobile, desktop apps. [Alternative to LaunchDarkly](https://configcat.com). Management app + feature flag SDKs.

[![Build Status](https://github.com/configcat/php-sdk/actions/workflows/php-ci.yml/badge.svg?branch=master)](https://github.com/configcat/php-sdk/actions/workflows/php-ci.yml)[![Latest Stable Version](https://camo.githubusercontent.com/d31832f1d3bc9136c5cd0bd5eb20bd740fc44853cbb0758b929e8746bd0205a1/68747470733a2f2f706f7365722e707567782e6f72672f636f6e6669676361742f636f6e6669676361742d636c69656e742f76657273696f6e)](https://packagist.org/packages/configcat/configcat-client)[![Total Downloads](https://camo.githubusercontent.com/9c6a545b28231af483388565b0e02aa2b91f5fd4571a2095c03061b6578742ed/68747470733a2f2f706f7365722e707567782e6f72672f636f6e6669676361742f636f6e6669676361742d636c69656e742f646f776e6c6f616473)](https://packagist.org/packages/configcat/configcat-client)[![Sonar Quality Gate](https://camo.githubusercontent.com/5c6a69e57f75fe03555d6560e2ae17713b34a3259cac79226853c11d9222285b/68747470733a2f2f696d672e736869656c64732e696f2f736f6e61722f7175616c6974795f676174652f636f6e6669676361745f7068702d73646b3f6c6f676f3d736f6e6172636c6f7564267365727665723d6874747073253341253246253246736f6e6172636c6f75642e696f)](https://sonarcloud.io/project/overview?id=configcat_php-sdk)[![Sonar Coverage](https://camo.githubusercontent.com/6ff65f197bb7af05ccc4f2020e665367ad6cd9c5d276911d767cdd1d2a7f0ca8/68747470733a2f2f696d672e736869656c64732e696f2f736f6e61722f636f7665726167652f636f6e6669676361745f7068702d73646b3f6c6f676f3d536f6e6172436c6f7564267365727665723d6874747073253341253246253246736f6e6172636c6f75642e696f)](https://sonarcloud.io/project/overview?id=configcat_php-sdk)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1

ConfigCat SDK for PHP &gt;= 7.1 is available [here](https://github.com/configcat/php7-sdk).

Getting started
---------------

[](#getting-started)

### 1. Install the package with [Composer](https://getcomposer.org/)

[](#1-install-the-package-with-composer)

```
composer require configcat/configcat-client
```

### 2. Go to the [ConfigCat Dashboard](https://app.configcat.com/sdkkey) to get your *SDK Key*:

[](#2-go-to-the-configcat-dashboard-to-get-your-sdk-key)

[![SDK-KEY](https://raw.githubusercontent.com/ConfigCat/php-sdk/master/media/readme02-3.png "SDK-KEY")](https://raw.githubusercontent.com/ConfigCat/php-sdk/master/media/readme02-3.png)

### 3. Create the *ConfigCat* client instance

[](#3-create-the-configcat-client-instance)

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

### 4. Get your setting value:

[](#4-get-your-setting-value)

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

Getting user specific setting values with Targeting
---------------------------------------------------

[](#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](https://configcat.com/docs/advanced/targeting/).

User object
-----------

[](#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) {
    doTheNewThing();
} else {
    doTheOldThing();
}
```

Sample/Demo app
---------------

[](#sampledemo-app)

- [Sample Laravel app](https://github.com/ConfigCat/php-sdk/tree/master/samples/laravel)

Need help?
----------

[](#need-help)

Contributing
------------

[](#contributing)

Contributions are welcome. For more info please read the [Contribution Guideline](CONTRIBUTING.md).

About ConfigCat
---------------

[](#about-configcat)

- [Official ConfigCat SDKs for other platforms](https://github.com/configcat)
- [Documentation](https://configcat.com/docs)
- [Blog](https://configcat.com/blog)

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance78

Regular maintenance activity

Popularity50

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 70.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~71 days

Recently: every ~171 days

Total

37

Last Release

119d ago

Major Versions

v4.1.0 → v5.0.02020-10-02

v5.4.1 → v6.0.02022-03-21

v6.2.1 → v7.0.02023-03-15

v7.1.1 → v8.0.02023-08-28

v8.1.0 → v9.0.02024-03-04

PHP version history (3 changes)1.0.0PHP &gt;=5.5

v6.0.0PHP &gt;=7.1

v7.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/1aafa26aa2864048c7a1d3f0c284fc6f438ef1bd05c7d87402562ad943fe4b29?d=identicon)[configcat](/maintainers/configcat)

---

Top Contributors

[![z4kn4fein](https://avatars.githubusercontent.com/u/13772020?v=4)](https://github.com/z4kn4fein "z4kn4fein (121 commits)")[![sigewuzhere](https://avatars.githubusercontent.com/u/58779216?v=4)](https://github.com/sigewuzhere "sigewuzhere (15 commits)")[![kp-cat](https://avatars.githubusercontent.com/u/52385411?v=4)](https://github.com/kp-cat "kp-cat (8 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![adams85](https://avatars.githubusercontent.com/u/31276480?v=4)](https://github.com/adams85 "adams85 (5 commits)")[![hpatoio](https://avatars.githubusercontent.com/u/249948?v=4)](https://github.com/hpatoio "hpatoio (3 commits)")[![rmikalkenas](https://avatars.githubusercontent.com/u/14221532?v=4)](https://github.com/rmikalkenas "rmikalkenas (2 commits)")[![mr-sige](https://avatars.githubusercontent.com/u/5901420?v=4)](https://github.com/mr-sige "mr-sige (2 commits)")[![tPl0ch](https://avatars.githubusercontent.com/u/115348?v=4)](https://github.com/tPl0ch "tPl0ch (1 commits)")[![zoltan-david](https://avatars.githubusercontent.com/u/54935463?v=4)](https://github.com/zoltan-david "zoltan-david (1 commits)")[![aurimasrim](https://avatars.githubusercontent.com/u/23396605?v=4)](https://github.com/aurimasrim "aurimasrim (1 commits)")[![david-zoltan](https://avatars.githubusercontent.com/u/37839928?v=4)](https://github.com/david-zoltan "david-zoltan (1 commits)")[![EspadaV8](https://avatars.githubusercontent.com/u/115825?v=4)](https://github.com/EspadaV8 "EspadaV8 (1 commits)")[![Koc](https://avatars.githubusercontent.com/u/191082?v=4)](https://github.com/Koc "Koc (1 commits)")[![laliconfigcat](https://avatars.githubusercontent.com/u/63732287?v=4)](https://github.com/laliconfigcat "laliconfigcat (1 commits)")[![leobeal](https://avatars.githubusercontent.com/u/12049134?v=4)](https://github.com/leobeal "leobeal (1 commits)")[![smottt](https://avatars.githubusercontent.com/u/619917?v=4)](https://github.com/smottt "smottt (1 commits)")

---

Tags

configcatconfigurationconfiguration-managementfeature-flagfeature-flagsfeature-togglefeature-togglesfeatureflagsphpremote-configfeature togglefeature flagconfigcatuser targeting

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/configcat-configcat-client/health.svg)

```
[![Health](https://phpackages.com/badges/configcat-configcat-client/health.svg)](https://phpackages.com/packages/configcat-configcat-client)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

517.9M7](/packages/avalara-avataxclient)[vin-sw/shopware-sdk

A PHP SDK for Shopware 6 Platform

122469.3k6](/packages/vin-sw-shopware-sdk)[commercetools/commercetools-sdk

The official PHP SDK for the commercetools Composable Commerce APIs

19281.5k](/packages/commercetools-commercetools-sdk)[alexacrm/dynamics-webapi-toolkit

Web API toolkit for Microsoft Dynamics 365 and Dynamics CRM

81324.1k1](/packages/alexacrm-dynamics-webapi-toolkit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
