js jwt decode

const jwt = require('jsonwebtoken');

const token = 'your_jwt_token_here';
const secretKey = 'your_secret_key_here';

const decodedToken = jwt.verify(token, secretKey);

console.log(decodedToken);
  1. Import the jsonwebtoken library.
  2. Set the JWT token and secret key.
  3. Use jwt.verify() to decode and verify the JWT token with the provided secret key.
  4. The decoded token is stored in the variable decodedToken.
  5. Print the decoded token to the console.