jwt-encode
Installation
SKILL.md
JWT Encode
Create and sign JWTs for testing and development.
Steps
- Gather inputs: claims/payload, algorithm (default: HS256), secret or key, expiration (default: 1 hour).
- Build header:
{"alg": "HS256", "typ": "JWT"}. Addkidif provided. - Build payload: Always include
iatandexpunless the user opts out. Add user-specified claims. - Sign the token using the best available method (see below).
- Display the result: the full JWT string and a decoded breakdown of header + payload.
Signing Methods
Pick the first available. Use the user's claims, secret, and algorithm — the examples below are templates only. Always pass the secret via an inline env var to avoid shell history exposure.
Node.js (preferred):
First, ensure jose is available — install it globally if missing: