PHP feature flags installation
Add the following to composer.json:
JSON
And then install the dependencies with the command:
Terminal
In your app, set your project API key before making any calls.
PHP
Note: As a rule of thumb, we do not recommend having API keys in plaintext. Setting it as an environment variable is best.
You can find your project API key and instance address in the project settings page in PostHog.
Next steps
| Resource | Description |
|---|---|
| Adding feature flag code | How to check flags in your code for all platforms |
| Framework-specific guides | Setup guides for React Native, Next.js, Flutter, and other frameworks |
| How to do a phased rollout | Gradually roll out features to minimize risk |
| More tutorials | Other real-world examples and use cases |