The @rhapsody/feature-flags package is now available and replaces both calling the Devise.hasFeature method and directly accessing Devise.current_user.features. The service exposes the hasFeatureFlag function to check if a user has a specific feature flag enabled.
Example
import { hasFeatureFlag } from '@rhapsody/feature-flags'
function greeting() {
if (hasFeatureFlag('excited_greeting')) {
return 'HOWDY!!! 👋'
} else {
return 'Hello'
}
}
The feature flag service is written in Typescript and can be used in JavaScript and Typescript code. New code should use this service and any existing non-Angular code should be refactored to use this service as well. Existing Angular code referencing Devise.hasFeature or Devise.current_user.features can be left as-is since both of these feature flag checking mechanisms use the feature flags service under the hood.