{"url":"https://github.com/auth0/jwt-decode/issues","bugs":{"url":"https://github.com/auth0/jwt-decode/issues"},"dist":{"shasum":"5993f8c031026d1cfbc44e8bc8e8b8eeae351a6f","tarball":"https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0-beta.3.tgz","fileCount":8,"integrity":"sha512-DKiYFDRg02NzBguVUqNTqEKdRnAYA5ylAY9qQl6NzIXQIUeRaWDwMbJf0ZKL4XYuvaOZRA1N8skgVC3g7Qi15Q==","signatures":[{"sig":"MEUCIQC1npOh0zL7rXqN6bnTlIBr93GUeflQI7GZDdtxk9B30QIgTP6UvC1RcJw1Ypboeg7erJ0uHe6M/mBXAzpzsuS1X7I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13127},"main":"build/cjs/index.js","name":"jwt-decode","type":"module","types":"build/cjs/index.d.ts","author":{"name":"Jose F. Romaniello","email":"jfromaniello@gmail.com"},"module":"build/esm/index.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 { jwtDecode } from \"jwt-decode\";\n\nconst token = \"eyJ0eXAiO.../// jwt token\";\nconst decoded = jwtDecode(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):\nconst decodedHeader = jwtDecode(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 `jwtDecode` 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 `jwtDecode` 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 = \"eyJhsw5c\";\nconst decoded = jwtDecode<JwtPayload>(token); // Returns with the JwtPayload type\n```\n\n#### Use as a CommonJS package\n\n```javascript\nconst { jwtDecode } = require('jwt-decode');\n...\n```\n\n#### Include with a script tag\n\nCopy the file `jwt-decode.js` from the root of the `build/esm` folder to your project somewhere, then import `jwtDecode` from it inside a script tag that's marked with `type=\"module\"`:\n\n```html\n<script type=\"module\">\n  import { jwtDecode } from \"/path/to/jwt-decode.js\";\n\n  const token = \"eyJhsw5c\";\n  const decoded = jwtDecode(token);\n</script>\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":{".":{"import":{"types":"./build/esm/index.d.ts","default":"./build/esm/index.js"},"require":{"types":"./build/cjs/index.d.ts","default":"./build/cjs/index.js"}}},"gitHead":"5ac1d0073a5cfa190057772d378587b2944ce429","license":"MIT","scripts":{"test":"npm run test:node && npm run test:browser","build":"tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json && echo '{\"type\": \"commonjs\"}'> build/cjs/package.json","prepack":"npm run build","prebuild":"rimraf build","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":"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.2","rimraf":"^5.0.1","ts-jest":"^29.1.1","ts-node":"^10.9.1","jest-junit":"^16.0.0","typescript":"^5.1.6","jest-environment-jsdom":"^29.6.2"},"_npmOperationalInternal":{"tmp":"tmp/jwt-decode_4.0.0-beta.3_1692186168913_0.2094108781178028","host":"s3://npm-registry-packages"},"_id":"jwt-decode@4.0.0-beta.3","version":"4.0.0-beta.3"}