Then you are stuck as you need to use a server to get the token, even if that token is then copied and pasted to the script.
The alternative to this is a downloadable program, as something like electron can capture the return in various ways, and then serve the content/script off a local webserver.
But it’s just easier to remote host it all in my opinion.