- What is featurit/featurit-sdk-php?
- It is the PHP SDK for Featurit feature management. It lets PHP applications evaluate feature flags and toggles, retrieve remote configuration, and control rollout behavior through a simple client API. You can use it in Laravel or in plain PHP projects.
- How do I install featurit/featurit-sdk-php?
- Install it with Composer using composer require featurit/featurit-sdk-php. After installation, configure the client with your Featurit credentials according to the package documentation. In Laravel, you will typically bind or register the client in a service provider so it can be injected where needed.
- Does this package work with Laravel?
- Yes, the SDK is a PHP package and can be used inside Laravel applications. It is not necessarily Laravel-specific, so you may need to wire it into Laravel's service container yourself. Check the package documentation for recommended Laravel setup and configuration patterns.
- Which PHP and Laravel versions are supported?
- Check the package's composer.json on Packagist for its PHP version constraint and dependency requirements. Laravel compatibility depends on your Laravel version and whether its PHP requirement matches the SDK's constraint. Because the SDK also works in plain PHP, it does not require Laravel to function.
- How do I check whether a feature is enabled?
- Use the SDK client's feature evaluation method with the feature key and any required user or context data. The exact method name and signature are documented in the package README or API reference. The result is typically a boolean or variation that tells your application which behavior to use.
- How do I configure my Featurit API key and environment?
- Provide your Featurit API key and environment details through the SDK configuration, ideally using environment variables rather than committing secrets to source control. The exact configuration keys and client initialization steps are covered in the official documentation. Keep separate credentials for development, staging, and production environments.
- Can I use this SDK for percentage rollouts and user targeting?
- Yes, Featurit is designed for feature management and controlled rollout behavior. You configure targeting rules and rollout percentages in the Featurit platform, then pass user or context identifiers when evaluating features in your PHP application. That lets the SDK evaluate the correct variation consistently for each user.
- How should I test code that uses featurit/featurit-sdk-php?
- Wrap the SDK client behind a small interface or service in your application so tests can substitute a fake implementation. In unit tests, mock feature evaluations to return enabled or disabled values instead of making network calls. Use a dedicated Featurit environment for integration tests that exercise the real SDK behavior.
- What should I consider for production performance and reliability?
- Review the SDK documentation for its caching, refresh, timeout, and fallback behavior before going to production. Avoid unnecessary per-request network calls by using the SDK's recommended configuration evaluation and caching approach. Also plan for how your application should behave if Featurit is temporarily unavailable.
- Is featurit/featurit-sdk-php an alternative to Laravel Pennant or LaunchDarkly?
- It is specifically the PHP SDK for the Featurit feature management platform, so it is not a drop-in replacement for Laravel Pennant or LaunchDarkly. Laravel Pennant is Laravel-native, while LaunchDarkly is a separate feature management service with its own SDKs. Choose Featurit if you want its platform, dashboard, remote configuration, and rollout capabilities behind a PHP client API.