Skip to content

PHP Configuration

use FlagsGG\Client;
$client = new Client(
cache: $customCache, // optional: cache backend
baseUrl: 'https://custom-api.flags.gg', // optional: API endpoint
maxRetries: 5, // optional: retry attempts
httpTimeout: 15 // optional: timeout in seconds
);
$client->setAuth(
projectId: 'your-project-id',
agentId: 'your-agent-id',
environmentId: 'your-environment-id'
);
Option Default Description
cache SQLite Cache backend (SQLite, Redis, or custom)
baseUrl https://api.flags.gg API endpoint
maxRetries 3 Max retry attempts
httpTimeout 10 HTTP timeout in seconds
Method Returns Description
setAuth(...) self Set authentication credentials
is(string $name) Flag Get a flag object (fluent API)
isEnabled(string $name) bool Check if a flag is enabled (shorthand)
list() FeatureFlag[] Get all flags
refetch() void Manually refresh cache from API

The SDK follows PHP-FIG standards and uses PSR-4 autoloading.