How can I get JWT token from api connector?

I want to get new JWT token from my application. I think that I should use api connector.
If you know this, could you teach the way?

⇒JWT https://jwt.io/

I solved by this solution.
I used javascript and don’t use API connector. Very easy way, I recommend!!
Tutorial for JWT generation · kjur/jsrsasign Wiki (github.com)

Can you explain what you did there with the javascript?