docs/util/decode_jwt/functions/decodeJwt.md
Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.
āø decodeJwt<PayloadType>(jwt): PayloadType & JWTPayload
Decodes the Claims Set of a JWT in Compact JWS serialization without checking its signature or validating claim types and values.
Use jwtVerify to verify signed JWTs or jwtDecrypt to decrypt and validate encrypted JWTs.
This function is exported (as a named export) from the main 'jose' module entry point as well
as from its subpath export 'jose/jwt/decode'.
| Type Parameter | Default type | Description |
|---|---|---|
PayloadType | JWTPayload | Type definition of the JWT Claims Set the token is expected to carry. |
| Parameter | Type | Description |
|---|---|---|
jwt | string | JWT token in compact JWS serialization. |
PayloadType & JWTPayload
The parsed JWT Claims Set.
const claims = jose.decodeJwt(token)
console.log(claims)