PHPackages                             featurit/featurit-sdk-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. featurit/featurit-sdk-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

featurit/featurit-sdk-php
=========================

PHP SDK for FeaturIT

v1.0.1(1y ago)31.7k2MITPHPPHP ^8.0.2

Since Nov 25Pushed 1y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (18)Versions (18)Used By (2)

FeaturIT SDK for PHP
====================

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

[![Build Status](https://camo.githubusercontent.com/d9a95b416b2631ef2b052460fe5044fa9fa3d158ecddd11a25a6b6559e52fdb8/68747470733a2f2f7472617669732d63692e6f72672f66656174757269742f66656174757269742d73646b2d7068702e737667)](https://travis-ci.org/laravel/framework)[![Total Downloads](https://camo.githubusercontent.com/bcc3224131ba77a7007459094bd15032d5b3afd045fac3d05cf511e268df1941/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66656174757269742f66656174757269742d73646b2d706870)](https://packagist.org/packages/featurit/featurit-sdk-php)[![Latest Stable Version](https://camo.githubusercontent.com/ab18c3ed6423e7cf681c26fd1e3c925d51ac698519b353d09752318ff65ba3f7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66656174757269742f66656174757269742d73646b2d706870)](https://packagist.org/packages/featurit/featurit-sdk-php)[![License](https://camo.githubusercontent.com/26382c232282e0b946d60d2b59da53c9ecd6ef016e1942c3cf7d7ccf8f12dd90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f66656174757269742f66656174757269742d73646b2d706870)](https://packagist.org/packages/featurit/featurit-sdk-php)

PHP client for the FeaturIT Feature Flag management platform.

Description
-----------

[](#description)

This package aims to simplify the integration of the FeaturIT API in a PHP project.

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

[](#getting-started)

### Dependencies

[](#dependencies)

- PHP &gt;= 8.0
- psr/http-client-implementation
- psr/simple-cache-implementation

### Installing

[](#installing)

`composer require featurit/featurit-sdk-php`

If there's no package providing psr/http-client-implementation, visit  and choose the package that better suits your project.

If there's no package providing psr/simple-cache-implementation, visit  and choose the package that better suits your project.

### Basic Usage

[](#basic-usage)

```
$featurit = new \Featurit\Client\Featurit(
    'my-tenant-subdomain',
    'my-environment-key'
);

$isFeatureFlagActive = $featurit->isActive('MY_FEATURE_NAME');

if ($isFeatureFlagActive) {
    my_feature_code();
}

```

### Segmentation Usage

[](#segmentation-usage)

This is useful when you want to show different versions of your features to your users depending on certain attributes.

```
$featurit = new \Featurit\Client\Featurit(
    'my-tenant-subdomain',
    'my-environment-key'
);

$userContext = new \Featurit\Client\Modules\Segmentation\DefaultFeaturitUserContext(
    '1234',
    '123af503',
    '192.168.1.1',
    [
        'role' => 'ADMIN',
        'email' => 'featurit.tech@gmail.com',
    ]
);

$featurit->setUserContext($userContext);

$isFeatureFlagActive = $featurit->isActive('MY_FEATURE_NAME');

if ($isFeatureFlagActive) {
    $featureVersion = $featurit->version('MY_FEATURE_NAME');

    if ($featureVersion == 'v1') {
        my_feature_v1_code();
    } else if ($featureVersion == 'v2') {
        my_feature_v2_code();
    }
}

```

### Creating a UserContextProvider

[](#creating-a-usercontextprovider)

In some cases you want to fill the UserContext data once and forget about it when checking for feature flags.

If that is your case you can implement your own UserContextProvider and pass it to the Featurit client constructor (we recommend using our builder in order to create a new Featurit client).

```
class MyFeaturitUserContextProvider implements FeaturitUserContextProvider

    public function getContext(): FeaturitUserContext
    {
        $contextData = get_my_context_data();

        return new DefaultFeaturitUserContext(
            $contextData['userId'],
            $contextData['sessionId'],
            $contextData['ipAddress'],
            [
                'role' => $contextData['role'],
                ...
            ]
        );
    }
}

```

### Event Tracking

[](#event-tracking)

In order to track some event in your application, you can add this once the event has happened:

```
$featurit = new \Featurit\Client\Featurit(
    'my-tenant-subdomain',
    'my-environment-key'
);

$userContext = new \Featurit\Client\Modules\Segmentation\DefaultFeaturitUserContext(
    '1234',
    '123af503',
    '192.168.1.1',
    [
        'role' => 'ADMIN',
        'email' => 'featurit.tech@gmail.com',
    ]
);

$featurit->setUserContext($userContext);

$featurit->trackPerson();

// trackPerson will track a new Person with the data set in the FeaturitUserContext.

$featurit->track('MY_EVENT_NAME', [
    'a_property_name' => 'a_property_value',
    'another_property_name' => 'another_property_value',
]);

```

All the events and people you track in the same request will be accumulated and associated to the current FeaturitUserContext, if for some reason you want to send the data immediately, you can do as follows:

```
$featurit->flush();

```

### Authors

[](#authors)

FeaturIT

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~49 days

Recently: every ~6 days

Total

17

Last Release

578d ago

Major Versions

v0.9.2 → v1.0.02025-01-17

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6544122?v=4)[Adrià Batlle Cuito](/maintainers/sudobat)[@sudobat](https://github.com/sudobat)

---

Top Contributors

[![sudobat](https://avatars.githubusercontent.com/u/6544122?v=4)](https://github.com/sudobat "sudobat (19 commits)")

---

Tags

featurefeature togglea b testingfeature flaguser targetingfeaturitfeature management

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/featurit-featurit-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/featurit-featurit-sdk-php/health.svg)](https://phpackages.com/packages/featurit-featurit-sdk-php)
```

###  Alternatives

[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36826.2k2](/packages/telnyx-telnyx-php)[shopware/app-php-sdk

Shopware App SDK for PHP

15120.5k3](/packages/shopware-app-php-sdk)[n1ebieski/ksef-php-client

PHP API client that allows you to interact with the API Krajowego Systemu e-Faktur

9082.3k](/packages/n1ebieski-ksef-php-client)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

86337.5k](/packages/flow-php-flow)[anthropic-ai/sdk

Anthropic PHP SDK

174884.4k25](/packages/anthropic-ai-sdk)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k29.9M347](/packages/openai-php-client)

PHPackages © 2026

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