Вот мой код:
const jwt = require('jsonwebtoken'); const payload = { "userid": "1234567890", "username": "Tutorials Website", "iat": 1516234022, "iat": 1516234022 } const token = jwt.sign(payload, 'your-secret', {expiresIn: '1d'})