Get Feature Service
The FeatureService handles the feature switches of the current customer in Suite. It can tell whether a feature is enabled for the customer. Calling the getter function will return a promise that will be resolved with the service.
It works in iframes as well, but the UI Kit and window.e.config must be present on top window, otherwise the promise won't resolve.
Usage
| Name | Description |
|---|---|
window.e.utils.v2.config.getFeatureService() |
Return an object that has isOn, isOff methods. |
Method Reference
| Name | Description |
|---|---|
isOn |
Return true if the feature turned on. |
isOff |
Return true if the feature turned off. |
Example
const featureService = await window.e.utils.v2.config.getFeatureService();
if (featureService.isOn('myFeature')) {
console.log('myFeture is on');
};