Search by

confeature / confeature-php-sdk

MakerLabs

Confeature PHP SDK. Drop-in compatible with configcat/configcat-php-sdk (Confeature Constitution Principle II).

Package info

github.com/confeature/confeature-php-sdk

Homepage

Issues

pkg:composer/confeature/confeature-php-sdk

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-10-16 11:40 UTC

This package is auto-updated.

Last update: 2026-10-16 12:08:56 UTC


README

confeature/confeature-php-sdk

PHP SDK for Confeature. Drop-in compatible with the upstream configcat/configcat-php-sdk package — class names, factory signatures, option keys, polling modes and override semantics mirror ConfigCat 1:1 (a project rule, checked by its conformance tests).

Install

composer require confeature/confeature-php-sdk

Requires PHP 8.1+.

The package is published from confeature/confeature-php-sdk, a read-only mirror of apps/sdk-php/ in confeature/sdks, where changes are made.

Quickstart

<?php

use Confeature\ConfeatureClient;
use Confeature\PollingMode;
use Confeature\User;

$client = ConfeatureClient::create('configcat-sdk-1/<22 chars>/<22 chars>', [
    'pollingMode' => PollingMode::autoPoll(),
]);

$user = new User('alice@example.com');
$enabled = $client->getValue('feature.dark-mode', false, $user);

$client->close();

SDK key format

Confeature mints SDK keys in ConfigCat's own shape, configcat-sdk-1/<22 chars>/<22 chars> (characters [A-Za-z0-9_-]), so the same key also works in a stock ConfigCat SDK. Keys minted earlier, confeature-sdk-1-<32 chars>-<32 chars>, stay valid until rotated. Confeature\Internal\SdkKey::isValidConfeatureKeyFormat() accepts both; any other string logs an INVALID_SDK_KEY warning (with the key redacted) but the client is still created. SDK keys never appear verbatim in a log line, and cache entries are named after a SHA-256 digest of the key, never the key itself.

Migrating from configcat/configcat-php-sdk

- use ConfigCat\ConfigCatClient as ConfeatureClient;
+ use Confeature\ConfeatureClient;
- $client = new ConfeatureClient('YOUR_SDK_KEY');
+ $client = ConfeatureClient::create('YOUR_SDK_KEY');

Full reference: https://docs.confeature.io/sdks/php/.

Licensed under MIT.