Swap.js is a JavaScript micro-library which facilitates AJAX-style navigation in web pages, in less than ~ 100 lines of code. (See "Why?" paragraph below)
Why do you think that https://github.com/authgear/authgear-example-spa-js is a good alternative to Swap