{"repo":"tsndr/cloudflare-worker-jwt","free":true,"listed":false,"github":"https://github.com/tsndr/cloudflare-worker-jwt","clone":"git clone https://github.com/tsndr/cloudflare-worker-jwt.git","description":"A lightweight JWT implementation with ZERO dependencies for Cloudflare Workers.","language":"TypeScript","stars":878,"topics":["jwt","jsonwebtoken","cloudflare-worker","cloudflare-workers","npm","npm-package","zero-dependency","zero-dependencies","lightweight","esm"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"Cloudflare Worker JWT A lightweight JWT implementation with ZERO dependencies for Cloudflare Workers. Contents - Install - Examples - Usage - Sign - Verify - Decode Install Examples Basic Example Restrict Timeframe Usage - Sign - Verify - Decode Sign sign(payload, secret, [options]) Signs a payload and returns the token. Arguments Argument Type Status Default Description ------------------------ ----------------------------------- -------- ----------- ----------- payload object required - The payload object. To use nbf (Not Before) and/or exp (Expiration Time) add nbf and/or exp to the payload. secret string , JsonWebKey , CryptoKey optional - A secret which is used to sign the payload. options string , object optional HS256 Either the algorithm string or an object. options.algorithm string optional HS256 See Available Algorithms options.header object optional undefined Extend the header of the resulting JWT. return Returns token as a string . Verify verify(token, secret, [options]) Verifies the integrity of the token. Argument Type Status Default Description ------------------------ ----------------------------------- -------- ------- ----------- token string required - The token string generated by sign() . secret string , JsonWebKey , CryptoKey optional - The secret which was used to sign the payload. options string , object optional HS256 Either the algorithm string or an object. options.algorithm string optional HS256 See Available Algorithms options.clockTolerance numbe","default_branch":null,"files":null,"tree":[],"storefront":"/r/tsndr","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tsndr/cloudflare-worker-jwt/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}