Restricting usage based on user count

Hi everyone,

We are developing a paid app and I have reviewed the following documentation to understand how to enable licensing:
Enabling Licensing for Your App

I have a few questions regarding this:

  1. Usage Limitation Based on User Count:
    We aim to limit the app’s usage based on the instance’s user count. For example, if one instance has 10 users and another has 25 users, we want the instance with 25 users to have a higher usage limit. I am considering using the Jira REST API to fetch the number of licensed users and then applying restrictions accordingly. Is this the right approach, or is there a better practice for implementing this?

  2. Handling User Tier Upgrades:
    How should we handle instances where the user count changes, such as an upgrade to a different user tier? Does Atlassian automatically track and restrict app usage based on these changes, or should we include logic in our code to manage this?

Thank you for your assistance!