# SDKs Reference
# Server Side SDKs
# Java SDK
In Java, feature toggling is made available through FeatureToggle.java
and returns the value of a toggle after resolving the enablement inheritance rules.
import com.marfeel.context.FeatureToggles;
import com.marfeel.enums.FeatureToggle;
if (FeatureToggles.hasFeature(FeatureToggle.YOUR_SUPER_COOL_FEATURE_NAME)) {
// CODE TO EXECUTE WHEN FEATURE IS ON
}
WARNING
The feature has to be added as java enum
in FeatureToggle.java
.
# JSP SDK
Feature toggles are made available to JSPs code via dali's FeatureTogglesTag
which returns the value of a toggle after resolving the enablement inheritance rules
<dali:hasFeature name="YOUR_SUPER_COOL_FEATURE_NAME">
// CODE TO EXECUTE WHEN FEATURE IS ON
</dali:hasFeature>
If you want to execute code when the feature is not present:
<dali:hasFeature name="YOUR_SUPER_COOL_FEATURE_NAME" value="${false}">
// CODE TO EXECUTE WHEN FEATURE IS OFF
</dali:hasFeature>
# Client Side SDKs
# Javascript SDK
Feature toggles are made available to Javascript code via the FeatureEnabler
module. The isFeatureOn
method is exposed and returns the value of a toggle after resolving the enablement inheritance rules
import { isFeatureOn } from 'featureEnabler';
close() {
if (this.isOpen) {
if (isFeatureOn('newUserJourneyEvents')) {
Metrics.trackCloseLateralMenu();
}
close.call(this);
}
}