Generate cryptographically secure signing secrets for HMAC-based JWT algorithms.
import jwt from 'jsonwebtoken';
const token = jwt.sign(
{ userId: 123 },
process.env.JWT_SECRET,
{ algorithm: 'HS256', expiresIn: '1h' }
);These secrets are generated using crypto.getRandomValues() and never leave your browser.