PHPackages                             researchsquare/exposure - 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. researchsquare/exposure

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

researchsquare/exposure
=======================

Selectively expose new features to a subset of your users.

0.0.1(10y ago)033.9k—6.3%1MITPHPPHP &gt;=5.3.0CI failing

Since Oct 7Pushed 5y ago8 watchersCompare

[ Source](https://github.com/researchsquare/exposure)[ Packagist](https://packagist.org/packages/researchsquare/exposure)[ Docs](http://github.com/researchsquare/exposure)[ RSS](/packages/researchsquare-exposure/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Exposure
========

[](#exposure)

Research Square's Exposure library provides basic feature flagging capabilities, allowing you to selectively expose new features to a subset of your users. This library was inspired by Etsy's [Feature API](https://github.com/etsy/feature).

**This library is very much in its early stages of development and could change dramatically in the future, though we hope to keep the public API fairly stable.**

At present, features can be completely enabled or disabled, enabled for specific users, or enabled for a percentage of users, allowing gradual availability of new features.

Regardless of the method chosen, feature checks are performed with:

```
if (Exposure\Feature::isEnabled('feature-name')) {
    // feature specific logic.
}
```

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

[](#installation)

Install the latest version with:

```
$ composer require researchsquare/exposure
```

Integration
-----------

[](#integration)

To use Exposure in your application, you will need to initialize it with your desired set of features and set the context under which it is operating. How this happens is largely an exercise for you to figure out, but features will typically be defined in your configuration, and Feature and its Context will be initialized during the bootstrapping of your application.

```
