How to identify lifecycles in jira custom UI forge app?

Hai all,
While installing custom UI forge app, app asked some configuration details and stored it in app storage in “@forge/api”. I need to delete that configuration details from app storage after the app gets uninstalled from the jira instance. I saw the lifecycle methods in connect app to do that.

https://developer.atlassian.com/cloud/jira/platform/connect-app-descriptor/#:~:text=Lifecycle%20HTTP%20request%20payload&text=App%20key%20that%20was%20installed,appears%20in%20your%20app’s%20descriptor.&text=In%20this%20case%2C%20any%20app,payload%20containing%20a%20different%20clientKey%20.

How can i do that in forge? My another question is How can i restrict app only for jira service management instance. When i tried to install an app using developer console, I didn’t get the jira service management instance in the list of instances available. I need to install an app only in jira service management instance. How can i do that. Kindly share your answers.

Thanks in advance…