How to add an option to disable/enable my custom ui forge projectPage app from jira

I have built a jira projectPage custom ui forge app and It appeats on the left side bar of my atlassian site under the App section like this

When a user visits the page by clicking on it, I want to let the user have an option of enabling or disabling the app, so that if disabled the app will no longer appear on the left side bar under the App section no more.

Hi, unfortunately, Forge doesn’t support the ability to show/hide modules based on user preferences. You can declare static [display conditions] in your manifest ( but that won’t support the use case you’re describing.
It is something we hope to support in the future, but it’s not currently planned. You can follow the public roadmap ticket here: Trello