Generate a time-based one-time password (TOTP) in Postman

I have a service with a one-time password, which I'm testing using the Postman app. Everything is fine except I have to use Google Authenticator/Microsoft Authenticator/Auth before every request which is quite annoying. But calculating time-based one-time password (TOTP) is a well-known algorithm. Moreover, the Postman can run JavaScript code before and after each request.

Calculate TOTP in JavaScript

If you Google for a second it is possible. For example, I found a very simple algorithm on, but it is a bit outdated because the jsSHA library changed a bit. The second try was, much better except JQuery. The only way to use it was to include full jsSHA in Postman Pre-request Script tab:

Full solution

The full code is quite long, 2314 lines, so I publish it at gist:

Possibility + algorithm = working solution