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.
Javascript:
window.e.utils.getFeatureService().then(featureService => {
if (featureService.isOn('myFeature')) {
console.log('myFeature is on');
}
});
Creating Feature Service
Method
Name | Description |
---|---|
window.e.utils.getFeatureService() |
Returns promise that resolves with feature service. |
Feature Service API Reference
Method
Name | Description |
---|---|
isOn(feature) |
Returns true if feature is on. |
isOff(feature) |
Returns true if feature is off. |