In your pop-up, create a button that makes a request for a Silent Authentication to renew the session.
To answer your second question, the Inactivity Lifetime is responsible for logging out an idle user. However, this cannot be accessed directly in code, as it is an attribute managed by the Auth0 server.
The flow I have provided previously can be used by setting the Idle Session Lifetime in your Auth0 Dashboard to a value slightly higher than the ID Token expiration (exp claim). This ensures that the user is prompted to extend their session right before both Lifetimes expire, resulting in the user taking an action on your client (extending the Inactivity Lifetime) and allowing the user to continue making authorized calls to your protected endpoints.
Please let me know if there is anything else you would like to know!