What do the parameters of the sign method of the library jsonwebtoken mean?

clipboard.png
pictures are taken from
here are some introductions, but not very clear.
what exactly is the use of the first and second parameters here.
at present, my understanding is that the first parameter can set the expiration time, the second parameter can be sprinkled with salt, and the later options seems to be repeated with the first parameter, which is a little baffling.
ask the great god for advice.

Jun.07,2022

parameter 1: payload means "load", which in this case is the data to be encrypted.
Parameter 2: secret is the real encrypted key

Menu