This repository contains an OpenFeature provider that allows ConfigCat to be used with the OpenFeature PHP SDK.
- PHP >= 8.1
composer require configcat/openfeature-provider
The ConfigCatProvider
constructor takes the SDK key and an optional array
argument containing the additional configuration options for the ConfigCat PHP SDK:
// 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('<YOUR-CONFIGCAT-SDK-KEY>', $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.
Contributions are welcome. For more info please read the Contribution Guideline.
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.