How do I use new google identity JS library to work with sheets?

Google introduced new Sign In JS library(gsi) a long time ago but Google Sheets documentation still shows examples using gapi. What would be the best approach to combine/replace gapi with gsi? May I have an example?