https://github.com/configcat/openfeature-php
ConfigCat OpenFeature Provider for PHP.
https://github.com/configcat/openfeature-php
configcat feature-flag feature-flagging featureflags featuretoggles openfeature php remote-configuration
Last synced: about 2 months ago
JSON representation
ConfigCat OpenFeature Provider for PHP.
- Host: GitHub
- URL: https://github.com/configcat/openfeature-php
- Owner: configcat
- License: mit
- Created: 2024-07-30T12:25:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-12-15T21:08:53.000Z (3 months ago)
- Last Synced: 2025-12-29T17:06:42.247Z (2 months ago)
- Topics: configcat, feature-flag, feature-flagging, featureflags, featuretoggles, openfeature, php, remote-configuration
- Language: PHP
- Homepage: https://configcat.com/docs/sdk-reference/openfeature/php
- Size: 45.9 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# ConfigCat OpenFeature Provider for PHP
[](https://github.com/configcat/openfeature-php/actions/workflows/ci.yml)
[](https://packagist.org/packages/configcat/openfeature-provider)
[](https://packagist.org/packages/configcat/openfeature-provider)
This repository contains an OpenFeature provider that allows [ConfigCat](https://configcat.com) to be used with the [OpenFeature PHP SDK](https://github.com/open-feature/php-sdk).
## Requirements
- PHP >= 8.1
## Installation
```sh
composer require configcat/openfeature-provider
```
## Usage
The `ConfigCatProvider` constructor takes the SDK key and an optional `array` argument containing the additional configuration options for the [ConfigCat PHP SDK](https://github.com/configcat/php-sdk):
```php
// Acquire an OpenFeature API instance.
$api = OpenFeatureAPI::getInstance();
// Build options for the ConfigCat SDK.
$options = [
ClientOptions::LOG_LEVEL => LogLevel::WARNING,
ClientOptions::CACHE_REFRESH_INTERVAL => 5,
//...
];
// Configure the provider.
$api->setProvider(new ConfigCatProvider('', $options));
// Create a client.
$client = $api->getClient();
// Evaluate a feature flag.
$isMyAwesomeFeatureEnabled = $client->getBooleanValue('isMyAwesomeFeatureEnabled', false);
```
For more information about all the configuration options, see the [PHP SDK documentation](https://configcat.com/docs/sdk-reference/php/#creating-the-configcat-client).
## Need help?
https://configcat.com/support
## Contributing
Contributions are welcome. For more info please read the [Contribution Guideline](CONTRIBUTING.md).
## About 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 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. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
- [Official ConfigCat SDKs for other platforms](https://github.com/configcat)
- [Documentation](https://configcat.com/docs)
- [Blog](https://configcat.com/blog)