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'
);
OptionDefaultDescription
cacheSQLiteCache backend (SQLite, Redis, or custom)
baseUrlhttps://api.flags.ggAPI endpoint
maxRetries3Max retry attempts
httpTimeout10HTTP timeout in seconds
MethodReturnsDescription
setAuth(...)selfSet authentication credentials
is(string $name)FlagGet a flag object (fluent API)
isEnabled(string $name)boolCheck if a flag is enabled (shorthand)
list()FeatureFlag[]Get all flags
refetch()voidManually refresh cache from API

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