What are features?
Features are defined as resources in your app you want to protect. The features management page allows you to add new features and edit existing ones. Features are assigned with designated keys
and permissions
Importance of feature keys
Feature keys play a crucial role in Frontegg's Entitlements Engine by serving as identifiers for specific features within an application that need to be protected or granted access to certain users. These keys are integral to the customization and tailoring of features according to the needs of different user roles and subscription plans. This field is mandatory when creating a new feature.
Creating a new feature
To add a new feature, go to [ENVIRONMENT] → Configurations → Entitlenments → Features.
- Click “add new feature”
- Add feature name - the internal name of the feature
- Add description (optional)
- Add key - create a key that you intend to use in your code. (key validation)
Permission tab
You can assign related permissions to the feature if you would like to protect the resource using the useEntitlementsPermission
function. This function will allow you to protect a resource by using permissions only.
You can assign related permissions to the feature if you would like to protect the resource using the useEntitlementsPermission
function. This function will allow you to protect a resource by using permissions only. he function useFeatureEntitlements
is used in Frontegg SDK to determine if a user is entitled to a specific feature, even when permissions are not directly assigned.
You can assign as many permissions as you wish to one feature. The best practice here would be to add the relevant permissions to the feature. For example; if you have an “SSO” feature, you can add sso.read
and sso.write
to the permission list [link to permission doc]. If a user will have one of the permissions (granted by their role), they will be entitled to use the SSO feature.
In order to link permission to a feature follow these steps:
- Click on the permission tab
- Click "Assign permissions"
- Choose the relevant permissions
- Click Assign permissions and save.
Assigning features to plans
When creating features, users won't be able to access them unless you assign them to a specific plan.