api.onPageChange not working with endless scroll

You don’t need a plugin, this is client side. Use a Theme Component.