Skip to main content

@cross/jwt@0.5.0
Built and signed on GitHub Actions

A versatile JSON Web Token (JWT) library with cross-runtime compatibility

This package works with Node.js, Deno, BunIt is unknown whether this package works with Cloudflare Workers, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
It is unknown whether this package works with Browsers
JSR Score
100%
Published
3 months ago (0.5.0)
f
createJWT

Creates a JWT with the given key and payload.

f
exportPEMKey

Exports a CryptoKey to PEM format.

I
ExportPEMKeyOptions

Options for PEM formatted file write.

f
generateKey

Generates an HMAC key from a provided secret string.

I
GenerateKeyOptions

Options for key generation

f
generateKeyPair

Generates an RSA or ECDSA key pair (public and private key).

I
GenerateKeyPairOptions

Options for key pair generation.

f
importPEMKey

Imports a CryptoKey from a PEM-formatted string or file.

I
JOSEHeader

The the JOSE header part of a JWT, JWS or JWE structure.

I
JWTOptions

Options for customizing JWT creation and parsing behavior.

I
JWTPayload

Represents the payload of a JWT. Includes optional standard claims and allows for theaddition of custom properties.See RFC 7519 (https://tools.ietf.org/html/rfc7519) for details on standard claims.

f
signJWT

Creates a JWT with the given key and payload.

T
SupportedKeyAlgorithms

Represents valid algorithm names for key generation using HMAC.

T
SupportedKeyPairAlgorithms

Represents valid algorithm names for generating key pairs using RSA, ECDSA and RSA-PSS.

f
unsafeParseJOSEHeader

"unsafely" parse the JOSE header of a JWT without cryptokey.

f
unsafeParseJWT

"unsafely" parse a JWT without cryptokey.

f
validateJWT

Validates and parses a JWT, verifies it with the given key, and returns the contained payload.

f
verifyJWT

Validates and parses a JWT, verifies it with the given key, and returns the contained payload.