PHPackages                             featureswitches/featureswitches-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. featureswitches/featureswitches-php

ActiveLibrary

featureswitches/featureswitches-php
===================================

Official PHP API Client for FeatureSwitches

v0.8.6(10y ago)092MITPHPPHP &gt;=5.5.0

Since Mar 23Pushed 10y agoCompare

[ Source](https://github.com/FeatureSwitches/featureswitches-php)[ Packagist](https://packagist.org/packages/featureswitches/featureswitches-php)[ Docs](https://github.com/featureswitches/featureswitches-php)[ RSS](/packages/featureswitches-featureswitches-php/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (8)Used By (0)

Featureswitches
===============

[](#featureswitches)

A PHP client library for interacting with [FeatureSwitches.com](https://featureswitches.com). This library is under active development and is likely to change frequently. Bug reports and pull requests are welcome.

Installation
------------

[](#installation)

Install with [Composer](https://getcomposer.org/)

```
php composer.phar require featureswitches/featureswitches-php
```

Usage
-----

[](#usage)

```
require 'vendor/autoload.php';

// Create a new FSClient with your customer and environment API key's
$featureswitches = new FeatureSwitches\FSClient('customer_api_key', 'environment_api_key', array('options'));

// Ensure that the API credentials are valid
$result = $featureswitches->authenticate();  # result will be true/false to indicate success

// Sync feature state
$featureswitches->sync();

// Add a user
$result = $featureswitches->addUser('user_identifier', 'optional_customer_identifier', 'optional_name', 'optional_email');

// Check if a feature is enabled
$result = $featureswitches->isEnabled('feature_key', 'optional_user_identifier', default(true/false, default=false));

if ($result == true) {
    // Feature enabled, do something
} else {
    // Feature disabled, do something else
}
```

### Configuration Options

[](#configuration-options)

The library locally caches responses from the FeatureSwitches API to cut down on response time and repeat requests. The default cache timeout is 300 seconds (5 minutes). You can adjust the cache timeout by providing the 'cache\_timeout' config option when initializing the library.

```
array(
    'cache_timeout' => SECONDS, // optional, defaults to 300 seconds
)
```

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

[](#contributing)

Bug reports and pull requests are welcome on GitHub at .

License
-------

[](#license)

The library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% 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 ~1 days

Total

6

Last Release

3695d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a46134515865e7e683bd4fb7ea3abb3fa52c8ef827cba4b632e41ddf5f9ae417?d=identicon)[featureswitches](/maintainers/featureswitches)

---

Top Contributors

[![mathamoz](https://avatars.githubusercontent.com/u/70219?v=4)](https://github.com/mathamoz "mathamoz (10 commits)")[![Jamesking56](https://avatars.githubusercontent.com/u/253237?v=4)](https://github.com/Jamesking56 "Jamesking56 (1 commits)")

---

Tags

featureswitchesfeatureswitches php

### Embed Badge

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

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k5](/packages/elgg-elgg)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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