Remote Feature Flags
The Content BFF (Backend for Frontend) service acts as a transformation layer for CMS responses to the frontend. When the frontend sends a request, it includes a header X-Device-Type, X-App-Version specifying the version number. The Content BFF service reads this header to determine the version and then connects to the CMS to fetch the remote feature flags available for the tenant. Upon receiving the JSON response from the CMS, BFF service applies necessary transformations to simplify the JSON, retaining only the feature flags relevant to the specified version. This transformed JSON is then returned to the frontend, ensuring that the frontend receives a streamlined and version-specific set of feature flags, thereby enhancing the efficiency and clarity of the data exchange.
Confluence link: https://confluence-extern.plus.aok.de/spaces/PLATT/pages/286785761/Remote+feature+flag+WIP
CMS Data
[
{
"remoteflags": [
{
"featureName": "feature-a",
"displayName": "Feature A",
"isDeleted": false,
"isEnabled": true,
"conditionSets": [
{
"isEnabled": true,
"deviceType": "iOS",
"condition": "minVersion",
"versionNumber": "12.4.0"
}
]
},
{
"featureName": "feature-b",
"displayName": "Feature B",
"isDeleted": false,
"isEnabled": true,
"conditionSets": []
},
{
"featureName": "feature-c",
"displayName": "Feature C",
"isDeleted": false,
"isEnabled": false,
"conditionSets": []
},
{
"featureName": "feature-d",
"displayName": "Feature D",
"isDeleted": false,
"isEnabled": true,
"conditionSets": [
{
"isEnabled": false,
"deviceType": "iOS",
"condition": "minVersion",
"versionNumber": "12.4.0"
}
]
},
{
"featureName": "feature-e",
"displayName": "Feature E",
"isDeleted": false,
"isEnabled": true,
"conditionSets": [
{
"isEnabled": true,
"deviceType": "android",
"condition": "minVersion",
"versionNumber": "12.4.0"
}
]
}
]
}
]
Backend API
Url: HOST_URL/contentservice/api/v1/feature-flags?aokid=aokplus
X-Device-Type: iOS/android/both
X-App-Version: version_number
CMS Data manipulation and BFF response
Field | Comments |
---|---|
isDeleted = true | soft delete the cms record |
Feature level isEnabled = true && conditionSets = [] | Feature flag is true for any device and version |
Feature level isEnabled = true && device specific condition is available but isEnabled = false | Feature flag is false for the device |
Feature level isEnabled = false && conditionSets = [] | Feature flag is false for any device and version |
Feature level isEnabled = false && device specific condition is available | Feature flag is false for the device |
----- FAQ -----
Q: How to add a feature for all device and version?
A: Add feature level data without condition sets.
Q: How to add a feature only for a specific device type and a starting version.?
A: See CMS data of feature-e.
Q: How to add a feature only for iOS and android device type and a starting version.?
A: Change deviceType to both in feature-e.
Q: How to add a feature only for iOS device type and a specific version.?
A: Change condition to specificVersion in feature-a. Same way excludeVersion possible.
Backend response
{
"feature-k": {
"displayName": "Feature K",
"enabled": false
},
"feature-o": {
"displayName": "Feature O",
"enabled": true
}
}