## What are plans? The Entitlements Engine is built on four core components: Users, Permissions, Features, and Plans. This topic will focus on the Plans component. Plans can include a stack of features or a single feature and can be assigned to specific users or accounts. This allows creating subscription plans that cater to different user needs or to segment users to be eligible to access specific features as part of their plan. ### Benefits of incorporating plans into your business model There are several ways to effectively use plans in your account. You can create plans that incorporate multiple features, assign them to accounts, and manage trials with specific time limits. Additionally, plans can help you establish a tiered pricing model, making it easier for customers to select options that fit their needs and budget, while simplifying management on your end. The plans dashboard (located under [ENVIRONMENT] → Configurations → Entitlements → Plans) allows you to view, edit, or add a new plan. Let's create your first plan. br ![plans](/assets/plans-dashboard.7cc7acdabd1dde2853d882151f8c15e69f79068d5c8d119e84ab206ece2614bd.9a6f05a0.png) br ### Creating a new feature plan To create your first plan, go to [ENVIRONMENT] → Configurations → Entitlements → Plans and perform the following steps: 1. Click the **Create plan** button located at the top right side of the page. 1. Name - add the relevant name to the plan. 2. Advanced - 1. **Grant to all new accounts** - This ability allows you to create an automatic trial. Upon account creation, the account will be granted the plan automatically. 2. **Indefinite or time-bound** - Allowing you to limit the time the plan is assigned to the account/users. If you wish to enroll users in a trial period, you can set the trial time limitation in advance. br ![plans](/assets/new-plan.3ec4167bf7229a4d4d39c74b88e33d720bf213eff970f35ac96bc3cb9986d3a3.9a6f05a0.png) br Once you create a plan, it's time to assign and edit features, accounts, and users. - Assign features - add features to the Plan. - Assign accounts—add accounts to your Plan. When an account is assigned, all users belonging to that account will be granted access to the account's plan. - Assign users - add specific users to be included in a plan. br ![plans](/assets/assign-users-to-plan.0f0cdce73161d6c5b6906a9beb503ca4717b31ba567e2bc411502760ed1e686f.9a6f05a0.png) br ![plans](/assets/assign-users-to-plan-2.833e34dfaafc60d4aed02e8afc275d0bee6bcef8e345e22b738f689a44d9c640.9a6f05a0.png) br #### Creating a time-limited plan You can manually limit the expiration of a Plan for accounts and users. This capability allows you to control users' access and grant time-bound access for different use cases. The screenshot below shows how to create a time-bound plan for a specific user ([ENVIRONMENT] → Configurations → Entitlements → Users). br ![plans](/assets/set-time-limit-users.7e4b16ef13e9d8f6bed77574cbeb5333cba7128c121f8ea44e8331cc85206736.9a6f05a0.png) br Time expiration precedence If a user is being granted the same plan with different time expirations, they will be entitled to the longest time period between the two. ## Advanced user targeting Advanced targeting allows you to enroll users in a plan according to specific attributes (either Frontegg attributes, Custom attributes, or JWT attributes). To create designated user access to plans, go to [ENVIRONMENT] → Configurations → Entitlements → Plans → Advanced Targeting → Add rule and select the attributes you wish to apply for the plan. You can add multiple rules for each plan (limitations are specified in the [Plan Rule Limitations](#Plan-Rule-Limitations)) below. ![plans](/assets/advance-targeting-json.5e85ee53417c79ad3d4394dcf9f8ca95e8c9edda287a9bc6c94ec41e6d14fd12.9a6f05a0.png) br Users and Advanced Rules Note that when you set targeting rules via the Advanced targeting option in plans, the rules will be checked for compatibility with all users and will target those that apply to the rule. A different option is to assign plans to specific users via the users' tab, but that is not to say that advanced targeting is applicable only to the users you add to the users' tab. ### Attributes for plan targeting The default Frontegg attributes we offer are: email (`frontegg.email`), email verified (`frontegg.emailVerified`), user ID (`frontegg.userId`), and tenant ID (`frontegg.tenantId`). These attributes are included in your drop-down attributes menu. Custom attributes can also be used in addition to Frontegg's attributes. Learn more about custom attributes in the following section. br ![plans](/assets/attributes-for-plan-targeting.fdf6602bb0187f140f7c9cd1df7aba74e8ae865c80efc3385c9434cc8f6587f2.9a6f05a0.png) br ## Custom attributes You can create custom attributes to fine-grain your users' enrollment in a plan. When creating custom attributes, the attribute **Key** and **Value** you set in your code must correlate with the text you input in the **Attribute** and **Value/Segment** fields. br ![plans](/assets/custom-attribute.aee48798d317b3089c63e66fa98e0fbe61bc05a52fc45e594fe7259191f5cff3.9a6f05a0.png) br ### JWT attributes In addition to **Custom** attributes and default **Frontegg attributes**, you can target attributes from the user's JWT. Since we flatten the `jwt` object, you can access its nested properties, including arrays. For example, if you store information such as the user's date of birth as `dateOfBirth`, then you can target this attribute by inputting a `jwt.dateOfBirth` in the attribute field. **For JWT attributes, you need to use the `jwt` prefix.** br ![plans](/assets/jwt-attribute.3cde071592842bf32e99bd3b76f92d4c2305a184c7960f4232945948efb3e6c3.9a6f05a0.png) br ### Plan rule limitations When creating an advanced targeting rule for a plan, note the following limitations: - Each environment (development/staging/production) is limited to **100 plans** ([Contact us](https://support.frontegg.com/hc/en-us/requests/new) if you need to exceed this limitation). - Each *plan* can have up to **10 rules**. - Each *Rule* is limited to **10 conditions**. - The *Attribute* field is limited to **100 characters**. - The *Value/Segment* field can contain up to **25 items**. - Each *Value/Segment* is limited to **50 characters**.