{"url":"https://github.com/auth0/jwt-decode/issues","bugs":{"url":"https://github.com/auth0/jwt-decode/issues"},"dist":{"shasum":"70507b8c84b71ba629427f26a38b0defe438238c","tarball":"https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0-beta.1.tgz","fileCount":25,"integrity":"sha512-GErNB1m+VKFgHiIAzsOiaAvxIzKM1o7fe0N7tkWZUz/oc9jFbFA7efDlV0wN7L9IP91VjK07Yr3Vx+YS4B4pmA==","signatures":[{"sig":"MEYCIQDG75lFK+joj3kB3hc0koU5e+krvnhZqxQkClMW6HzTdAIhAOm2t38Mpal4ImmhpzEDq35AqGBr2wXxp2nzdSc0E6yd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21119},"main":"build/cjs/jwt-decode.js","name":"jwt-decode","type":"module","types":"build/typings/index.d.ts","author":{"name":"Jose F. Romaniello","email":"jfromaniello@gmail.com"},"module":"build/esm/jwt-decode.js","readme":"![Browser library that helps decoding JWT tokens which are Base64Url encoded](https://cdn.auth0.com/website/sdks/banners/jwt-decode-banner.png)\n\n**IMPORTANT:** This library doesn't validate the token, any well-formed JWT can be decoded. You should validate the token in your server-side logic by using something like [express-jwt](https://github.com/auth0/express-jwt), [koa-jwt](https://github.com/stiang/koa-jwt), [Microsoft.AspNetCore.Authentication.JwtBearer](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.JwtBearer), etc.\n\n![Release](https://img.shields.io/npm/v/jwt-decode)\n![Downloads](https://img.shields.io/npm/dw/jwt-decode)\n[![License](https://img.shields.io/:license-MIT-blue.svg?style=flat)](https://opensource.org/licenses/MIT)\n[![CircleCI](https://img.shields.io/circleci/build/github/auth0/jwt-decode)](https://circleci.com/gh/auth0/jwt-decode)\n\n:books: [Documentation](#documentation) - :rocket: [Getting Started](#getting-started) - :speech_balloon: [Feedback](#feedback)\n\n## Documentation\n\n- [Docs site](https://www.auth0.com/docs) - explore our docs site and learn more about Auth0.\n\n## Getting started\n\n### Installation\n\nInstall with NPM or Yarn.\n\nRun `npm install jwt-decode` or `yarn add jwt-decode` to install the library.\n\n### Usage\n\n```js\nimport jwt_decode from \"jwt-decode\";\n\nvar token = \"eyJ0eXAiO.../// jwt token\";\nvar decoded = jwt_decode(token);\n\nconsole.log(decoded);\n\n/* prints:\n * { \n *   foo: \"bar\",\n *   exp: 1393286893,\n *   iat: 1393268893  \n * }\n */\n\n// decode header by passing in options (useful for when you need `kid` to verify a JWT):\nvar decodedHeader = jwt_decode(token, { header: true });\nconsole.log(decodedHeader);\n\n/* prints:\n * { \n *   typ: \"JWT\",\n *   alg: \"HS256\" \n * }\n */\n```\n\n**Note:** A falsy or malformed token will throw an `InvalidTokenError` error; see below for more information on specific errors.\n\n## Errors\n\nThis library works with valid JSON web tokens. The basic format of these token is\n```\n[part1].[part2].[part3]\n```\nAll parts are supposed to be valid base64 (url) encoded json.\nDepending on the `{ header: <option> }` option it will decode part 1 (only if header: true is specified) or part 2 (default)\n\nNot adhering to the format will result in a `InvalidTokenError` with one of the following messages:\n\n- `Invalid token specified: must be a string` => the token passed was not a string, this library only works on strings. \n- `Invalid token specified: missing part #` => this probably means you are missing a dot (`.`) in the token \n- `Invalid token specified: invalid base64 for part #` => the part could not be base64 decoded (the message should contain the error the base64 decoder gave)\n- `Invalid token specified: invalid json for part #` => the part was correctly base64 decoded, however, the decoded value was not valid JSON (the message should contain the error the JSON parser gave)\n\n#### Use with typescript\n\nThe return type of the `jwt_decode` function is determined by the `header` property of the object passed as the second argument. If omitted (or set to false), it'll use `JwtPayload`, when true it will use `JwtHeader`. \nIf needed, you can specify what the expected return type should be by passing a type argument to the `jwt_decode` function.\n\nYou can extend both `JwtHeader` and `JwtPayload` to include non-standard claims or properties.\n\n```typescript\nimport jwtDecode from \"jwt-decode\";\n\nconst token: string = \"eyJhsw5c\";\nconst decoded = jwtDecode<JwtPayload>(token); // Returns with the JwtPayload type\n```\n\n#### Use as a CommonJS package\n\n```javascript\nconst jwt_decode = require('jwt-decode');\n...\n```\n\n#### Include with a script tag\n\nCopy the file `jwt-decode.js` from the `build/` folder to your project somewhere, then include it like so:\n\n```html\n<script src=\"jwt-decode.js\"></script>\n```\n\n\n## Feedback\n\n### Contributing\n\nWe appreciate feedback and contribution to this repo! Before you get started, please see the following:\n\n- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)\n- [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)\n\n### Raise an issue\n\nTo provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/auth0/jwt-decode/issues).\n\n### Vulnerability Reporting\n\nPlease do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues.\n\n---\n\n<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png\"   width=\"150\">\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://cdn.auth0.com/website/sdks/logos/auth0_dark_mode.png\" width=\"150\">\n    <img alt=\"Auth0 Logo\" src=\"https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png\" width=\"150\">\n  </picture>\n</p>\n<p align=\"center\">Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout <a href=\"https://auth0.com/why-auth0\">Why Auth0?</a></p>\n<p align=\"center\">\nThis project is licensed under the MIT license. See the <a href=\"./LICENSE\"> LICENSE</a> file for more info.</p>\n","engines":{"node":">=16"},"exports":{".":{"types":"./build/typings/index.d.ts","import":"./build/esm/jwt-decode.js","require":"./build/cjs/jwt-decode.js"}},"gitHead":"1d8b6575c83071540469467536c51c72712db2bb","license":"MIT","scripts":{"dev":"rollup --sourcemap --config --configPlugin typescript","test":"npm run test:node && npm run test:browser","build":"rimraf build && rollup --sourcemap --config --configPlugin typescript --environment NODE_ENV:production","prepack":"npm run build","postbuild":"echo '{\"type\": \"commonjs\"}'> build/cjs/package.json","test:node":"NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --coverage","test:browser":"NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --coverage --testEnvironment=jsdom"},"_npmUser":{"name":"auth0-oss","email":"oss.sdks@auth0.com"},"homepage":"https://github.com/auth0/jwt-decode#readme","keywords":["jwt","browser"],"repository":{"url":"git://github.com/auth0/jwt-decode.git","type":"git"},"_npmVersion":"7.19.1","description":"Decode JWT tokens, mostly useful for browser applications.","directories":{},"maintainers":[{"name":"enriquepina","email":"enrique.pina@auth0.com"},{"name":"ece-okta","email":"ece.tavasli@auth0.com"},{"name":"soumyabodavula5","email":"soumya.bodavula@okta.com"},{"name":"pubalokta","email":"pablo.ubal@okta.com"},{"name":"dougmiller-okta","email":"douglas.miller@auth0.com"},{"name":"zak.nour","email":"zak.nour@auth0.com"},{"name":"stheller","email":"stefan.heller@auth0.com"},{"name":"jamescgarrett-okta","email":"james.garrett@auth0.com"},{"name":"madhuri.rm23","email":"madhuri.ravindramohan@okta.com"},{"name":"willvedd","email":"willvedd@gmail.com"},{"name":"david.renaud.okta","email":"david.renaud@okta.com"},{"name":"jeff.shuman","email":"jeff.shuman@auth0.com"},{"name":"auth0-oss","email":"oss.sdks@auth0.com"},{"name":"codepete","email":"peter.ung@auth0.com"},{"name":"ziluvatar","email":"eduardo.diaz@okta.com"},{"name":"iaco","email":"sebastian.iacomuzzi@gmail.com"},{"name":"cocojoe","email":"martin.walsh@gmail.com"},{"name":"auth0npm","email":"devops+npm@auth0.com"},{"name":"auth0brokkr","email":"support@auth0.com"},{"name":"hzalaz","email":"hernan@auth0.com"},{"name":"aaguiarz","email":"andres.aguiar@gmail.com"},{"name":"charlesrea","email":"charles.rea@auth0.com"},{"name":"lbalmaceda","email":"balmacedaluciano@gmail.com"},{"name":"julien.wollscheid","email":"julien.wollscheid@auth0.com"},{"name":"cristiandouce","email":"cristiandouce@gmail.com"},{"name":"sambego","email":"sambellen@gmail.com"},{"name":"stevehobbsdev","email":"steve.hobbs@auth0.com"},{"name":"sandrinodimattia","email":"sandrino@dimattia.be"},{"name":"lzychowski","email":"les.zychowski@auth0.com"},{"name":"joshcanhelp","email":"josh@joshcanhelp.com"},{"name":"rob.coles","email":"rob.coles@auth0.com"},{"name":"rosnovsky","email":"artem@rosnovsky.us"},{"name":"davidpatrick0","email":"david.patrick@auth0.com"},{"name":"widcket","email":"zeta@widcket.com"},{"name":"adamjmcgrath","email":"adamjmcgrath@gmail.com"},{"name":"jim.andersoon","email":"jim.anderson@auth0.com"},{"name":"frederikprijck","email":"frederik.prijck@gmail.com"},{"name":"sergii.biienko","email":"sergii.biienko@auth0.com"},{"name":"tomauth0","email":"tom.carter@auth0.com"},{"name":"jpadilla","email":"hello@jpadilla.com"},{"name":"jessele","email":"jesse.le@auth0.com"},{"name":"rhamzeh_auth0","email":"raghd.hamzeh@auth0.com"},{"name":"greglopez","email":"greg.lopez@auth0.com"},{"name":"jfromaniello","email":"jfromaniello@gmail.com"},{"name":"heyitsry","email":"ryan.wilke@auth0.com"}],"_nodeVersion":"16.6.0","contributors":[{"name":"Sam Bellen","email":"sam.bellen@auth0.com"}],"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.6.1","rimraf":"^5.0.1","rollup":"^3.26.3","ts-jest":"^29.1.1","ts-node":"^10.9.1","jest-junit":"^16.0.0","typescript":"^5.1.6","rollup-plugin-serve":"^2.0.2","@rollup/plugin-terser":"^0.4.3","jest-environment-jsdom":"^29.6.1","rollup-plugin-livereload":"^2.0.5","@rollup/plugin-typescript":"^11.1.2"},"_npmOperationalInternal":{"tmp":"tmp/jwt-decode_4.0.0-beta.1_1690627741377_0.3291369649064251","host":"s3://npm-registry-packages"},"_id":"jwt-decode@4.0.0-beta.1","version":"4.0.0-beta.1"}