You might look here for dealing with serverside activities.
https://github.com/supabase-community/supabase-auth-helpers
If you have the session access token you can calculate if it is about to expire and refresh using supabase.auth.setSession(refreshtoken) if you also have the refresh token passed. (note: I've used this client side, you'll need to see if it works correctly serverside)