PHPackages                             open-feature/go-feature-flag-provider - 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. open-feature/go-feature-flag-provider

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

open-feature/go-feature-flag-provider
=====================================

The GO Feature Flag provider package for open-feature

1.0.0(1y ago)02.2k↓19.3%Apache-2.0PHPPHP ^8

Since Sep 4Pushed 1y ago2 watchersCompare

[ Source](https://github.com/open-feature-php/go-feature-flag-provider)[ Packagist](https://packagist.org/packages/open-feature/go-feature-flag-provider)[ RSS](/packages/open-feature-go-feature-flag-provider/feed)WikiDiscussions main Synced yesterday

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

 [![go-feature-flag logo](https://raw.githubusercontent.com/thomaspoignant/go-feature-flag/main/gofeatureflag.svg)](https://raw.githubusercontent.com/thomaspoignant/go-feature-flag/main/gofeatureflag.svg)

GO Feature Flag - OpenFeature PHP provider
==========================================

[](#go-feature-flag---openfeature-php-provider)

 [![](https://camo.githubusercontent.com/dfc3ff2afa7deca5e9e9a4bcb064a572e8be54748c9fa7463890ea302cdc1f38/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f70656e2d666561747572652f676f2d666561747572652d666c61672d70726f76696465723f636f6c6f723d626c7565266c6f676f3d706870)](https://packagist.org/packages/open-feature/go-feature-flag) [![](https://camo.githubusercontent.com/c716cff0dd9d1ce2ef58f1e54dca5c3e1d91fd58a839bc468a53b1b5f132a78c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f70656e2d666561747572652f676f2d666561747572652d666c61672d70726f76696465723f6c6f676f3d706870)](https://packagist.org/packages/open-feature/go-feature-flag) [![Packagist Version](https://camo.githubusercontent.com/b8fcb3b283208140d59709e9ab264046a267d1e2ea1d7af3a99a79a2e8d22fde/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f70656e2d666561747572652f676f2d666561747572652d666c61672d70726f76696465723f6c6f676f3d70687026636f6c6f723d626c7565)](https://camo.githubusercontent.com/b8fcb3b283208140d59709e9ab264046a267d1e2ea1d7af3a99a79a2e8d22fde/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f70656e2d666561747572652f676f2d666561747572652d666c61672d70726f76696465723f6c6f676f3d70687026636f6c6f723d626c7565) [![Documentation](https://camo.githubusercontent.com/986e3ffebe89526a9c69ceb90608a774eac15d10b2dbd48e636e37e23a5b641d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2546302539462539332539322d576562736974652d626c7565)](https://gofeatureflag.org/) [![Issues](https://camo.githubusercontent.com/e42b49c2cca67e7e2a83b78c00522069f38ce6c0121db56c8428ad56ce6f8890/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2545322539432538462545462542382538462d6973737565732d726564)](https://github.com/thomaspoignant/go-feature-flag/issues) [![Join us on slack](https://camo.githubusercontent.com/a4f7ea1d190a9c01865b9f487c4353af58f6b67afb0db56bfefba406b9870f08/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a6f696e2d75732532306f6e253230736c61636b2d677261792e7376673f6c6f6e6743616368653d74727565266c6f676f3d736c61636b26636f6c6f72423d677265656e)](https://gofeatureflag.org/slack)

This repository contains the official PHP OpenFeature provider for accessing your feature flags with [GO Feature Flag](https://gofeatureflag.org).

In conjunction with the [OpenFeature SDK](https://openfeature.dev/docs/reference/concepts/provider) you will be able to evaluate your feature flags in your Ruby applications.

For documentation related to flags management in GO Feature Flag, refer to the [GO Feature Flag documentation website](https://gofeatureflag.org/docs).

### Functionalities:

[](#functionalities)

- Manage the integration of the OpenFeature PHP SDK and GO Feature Flag relay-proxy.

Dependency Setup
----------------

[](#dependency-setup)

### Composer

[](#composer)

```
composer require open-feature/go-feature-flag-provider
```

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

[](#getting-started)

### Initialize the provider

[](#initialize-the-provider)

The `GoFeatureFlagProvider` takes a config object as parameter to be initialized.

The constructor of the config object has the following options:

**Option****Description**`endpoint`**(mandatory)** The URL to access to the relay-proxy.
*(example: `https://relay.proxy.gofeatureflag.org/`)*`apiKey`The token used to call the relay proxy.`customHeaders`Any headers you want to add to call the relay-proxy.`httpclient`The HTTP Client to use (if you want to use a custom one). *It has to be a `PSR-7` compliant implementation.*The only required option to create a `GoFeatureFlagProvider` is the URL *(`endpoint`)* to your GO Feature Flag relay-proxy instance.

```
use OpenFeature\Providers\GoFeatureFlag\config\Config;
use OpenFeature\Providers\GoFeatureFlag\GoFeatureFlagProvider;
use OpenFeature\implementation\flags\MutableEvaluationContext;
use OpenFeature\implementation\flags\Attributes;
use OpenFeature\OpenFeatureAPI;

$config = new Config('http://gofeatureflag.org', 'my-api-key');
$provider = new GoFeatureFlagProvider($config);

$api = OpenFeatureAPI::getInstance();
$api->setProvider($provider);
$client = $api->getClient();
$evaluationContext = new MutableEvaluationContext(
      "214b796a-807b-4697-b3a3-42de0ec10a37",
      new Attributes(["email" => 'contact@gofeatureflag.org'])
  );

$value = $client->getBooleanDetails('integer_key', false, $evaluationContext);
if ($value) {
    echo "The flag is enabled";
} else {
    echo "The flag is disabled";
}
```

The evaluation context is the way for the client to specify contextual data that GO Feature Flag uses to evaluate the feature flags, it allows to define rules on the flag.

The `targeting_key` is mandatory for GO Feature Flag to evaluate the feature flag, it could be the id of a user, a session ID or anything you find relevant to use as identifier during the evaluation.

### Evaluate a feature flag

[](#evaluate-a-feature-flag)

The client is used to retrieve values for the current `EvaluationContext`. For example, retrieving a boolean value for the flag **"my-flag"**:

```
$value = $client->getBooleanDetails('integer_key', false, $evaluationContext);
if ($value) {
  echo "The flag is enabled";
} else {
  echo "The flag is disabled";
}
```

GO Feature Flag supports different all OpenFeature supported types of feature flags, it means that you can use all the accessor directly

```
// Bool
$client->getBooleanDetails('my-flag-key', false, new MutableEvaluationContext("214b796a-807b-4697-b3a3-42de0ec10a37"));
$client->getBooleanValue('my-flag-key', false, new MutableEvaluationContext("214b796a-807b-4697-b3a3-42de0ec10a37"));

// String
$client->getStringDetails('my-flag-key', "default", new MutableEvaluationContext("214b796a-807b-4697-b3a3-42de0ec10a37"));
$client->getStringValue('my-flag-key', "default", new MutableEvaluationContext("214b796a-807b-4697-b3a3-42de0ec10a37"));

// Integer
$client->getIntegerDetails('my-flag-key', 1, new MutableEvaluationContext("214b796a-807b-4697-b3a3-42de0ec10a37"));
$client->getIntegerValue('my-flag-key', 1, new MutableEvaluationContext("214b796a-807b-4697-b3a3-42de0ec10a37"));

// Float
$client->getFloatDetails('my-flag-key', 1.1, new MutableEvaluationContext("214b796a-807b-4697-b3a3-42de0ec10a37"));
$client->getFloatValue('my-flag-key', 1.1, new MutableEvaluationContext("214b796a-807b-4697-b3a3-42de0ec10a37"));

// Object
$client->getObjectDetails('my-flag-key', ["default" => true], new MutableEvaluationContext("214b796a-807b-4697-b3a3-42de0ec10a37"));
$client->getObjectValue('my-flag-key', ["default" => true], new MutableEvaluationContext("214b796a-807b-4697-b3a3-42de0ec10a37"));
```

Features status
---------------

[](#features-status)

StatusFeatureDescription✅Flag evaluationIt is possible to evaluate all the type of flags❌CachingMechanism is in place to refresh the cache in case of configuration change❌Event StreamingNot supported by the SDK❌LoggingNot supported by the SDK❌Flag MetadataNot supported by the SDK**Implemented**: ✅ | In-progress: ⚠️ | Not implemented yet: ❌

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

[](#contributing)

This project welcomes contributions from the community. If you're interested in contributing, see the [contributors' guide](https://github.com/thomaspoignant/go-feature-flag/blob/main/CONTRIBUTING.md) for some helpful tips.

### PHP Versioning

[](#php-versioning)

This library targets PHP version 8.0 and newer. As long as you have any compatible version of PHP on your system you should be able to utilize the OpenFeature SDK.

This package also has a .tool-versions file for use with PHP version managers like asdf.

### Installation and Dependencies

[](#installation-and-dependencies)

Install dependencies with `composer install`, it will update the `composer.lock` with the most recent compatible versions.

We value having as few runtime dependencies as possible. The addition of any dependencies requires careful consideration and review.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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

Unknown

Total

1

Last Release

667d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/37b811aae08f6063ce4a6c9111849a2c8c5400b58718072c224c9eb8c46e5f17?d=identicon)[0xc](/maintainers/0xc)

---

Top Contributors

[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")[![thomaspoignant](https://avatars.githubusercontent.com/u/17908063?v=4)](https://github.com/thomaspoignant "thomaspoignant (1 commits)")

---

Tags

providerfeatureflagsfeatureflaggingopenfeaturegofeatureflag

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/open-feature-go-feature-flag-provider/health.svg)

```
[![Health](https://phpackages.com/badges/open-feature-go-feature-flag-provider/health.svg)](https://phpackages.com/packages/open-feature-go-feature-flag-provider)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

346132.9M112](/packages/google-cloud-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[oat-sa/tao-core

TAO core extension

66143.7k122](/packages/oat-sa-tao-core)

PHPackages © 2026

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