Feature toggles should be used sparingly in V4 and should be removed at the earliest possible point to avoid discrepencies between environments.
Unlike other Homeflow apps, working locally on V4 does not default to using a config yaml file for feature toggle but instead attempts to connect to the staging Redis server. This is to try to avoid differences between staging and local development because of missing settings in a developer's local config. However, connecting to the staging Redis server requires running an SSH tunnel, see details in Local Development.
When adding a new feature toggle you can set HOMEFLOW_FEATURE_TOGGLES_ENVIRONMENT=development in your .env.local. The V4 FeatureTogglesClient will then read your local setup from .homeflow-feature-toggles.yml, which should be added to the top level of the application. New feature toggles you are developing can then be added under development_features, eg:
development_features:
v4_health_check_request_self: true
See Confluence for further details on working with Homeflow Feature Toggles.
Feature toggles can be checked in V4 using the FeatureTogglesClient, which has one public method isEnabled('my_setting') to check the status of a feature toggle.
const ftClient = new FeatureTogglesClient();
const status = await ftClient.isEnabled('my_setting');