There’s a couple of things worth noting here, the
jsonwebtoken library supports signed JWT tokens, but it has no support for encryption/decryption. This would mean the data in the JWT would not be encrypted so from that perspective the library would not be useful.
Signing a JWT token in the browser would also be irrelevant because the signing key would need to be available to the browser, which would mean available to everyone that was also interested in obtaining it. This means using that library in the browser would not get you anything.
If you want to protect the data in-transit from the browser to the server then you should ensure you’re using HTTPS; this would mean the data (all of it) would indeed be encrypted when sent from the browser to the server.