{"name":"jwt-decode","version":"3.1.1","keywords":["jwt","browser"],"author":{"url":"http://joseoncode.com","name":"Jose F. Romaniello","email":"jfromaniello@gmail.com"},"license":"MIT","_id":"jwt-decode@3.1.1","maintainers":[{"name":"sergii.biienko","email":"sergii.biienko@auth0.com"},{"name":"frederikprijck","email":"frederik.prijck@gmail.com"},{"name":"navrupt","email":"navrup.tom@auth0.com"},{"name":"fadymak","email":"fmakram1@gmail.com"},{"name":"jim.andersoon","email":"jim.anderson@auth0.com"},{"name":"th3maio","email":"andre.demaio@auth0.com"},{"name":"ldoorz","email":"luis.britos-manriquez@auth0.com"},{"name":"adamjmcgrath","email":"adamjmcgrath@gmail.com"},{"name":"widcket","email":"zeta@widcket.com"},{"name":"davidpatrick0","email":"david.patrick@auth0.com"},{"name":"rosnovsky","email":"artem@rosnovsky.us"},{"name":"faroceann","email":"maxhammad@gmail.com"},{"name":"rob.coles","email":"rob.coles@auth0.com"},{"name":"joshcanhelp","email":"josh@joshcanhelp.com"},{"name":"lzychowski","email":"les.zychowski@auth0.com"},{"name":"luuuis","email":"luis.miranda@auth0.com"},{"name":"sandrinodimattia","email":"sandrino@dimattia.be"},{"name":"yacine-b","email":"yacine.brahimi@auth0.com"},{"name":"davidmoses","email":"david.moses@auth0.com"},{"name":"bmaxwella0","email":"brandon.maxwell@auth0.com"},{"name":"stevehobbsdev","email":"steve.hobbs@auth0.com"},{"name":"sambego","email":"sambellen@gmail.com"},{"name":"heyitsry","email":"ryan.wilke@auth0.com"},{"name":"cristiandouce","email":"cristiandouce@gmail.com"},{"name":"matchai","email":"hello@matchai.me"},{"name":"shawnmclean","email":"shawnrmclean@gmail.com"},{"name":"jstrutz","email":"j@jasonstrutz.com"},{"name":"ziluvatar","email":"eduardo.diaz@auth0.com"},{"name":"iaco","email":"sebastian.iacomuzzi@gmail.com"},{"name":"cocojoe","email":"martin.walsh@gmail.com"},{"name":"fyockm","email":"fyockm@gmail.com"},{"name":"auth0npm","email":"devops+npm@auth0.com"},{"name":"auth0alec","email":"alec.pesola@auth0.com"},{"name":"auth0brokkr","email":"support@auth0.com"},{"name":"hzalaz","email":"hernan@auth0.com"},{"name":"glena","email":"german.lena@gmail.com"},{"name":"aaguiarz","email":"andres.aguiar@gmail.com"},{"name":"machuga","email":"machuga+npm@gmail.com"},{"name":"lbalmaceda","email":"balmacedaluciano@gmail.com"},{"name":"jfromaniello","email":"jfromaniello@gmail.com"}],"contributors":[{"name":"Sam Bellen","email":"sam.bellen@auth0.com"}],"homepage":"https://github.com/auth0/jwt-decode#readme","bugs":{"url":"https://github.com/auth0/jwt-decode/issues"},"url":"https://github.com/auth0/jwt-decode/issues","dist":{"shasum":"526710779567c380910139f790da2910c529e49f","tarball":"http://registry-npm.ywwl.com/jwt-decode/download/jwt-decode-3.1.1.tgz","fileCount":11,"integrity":"sha512-EaH9dTD9ogCmxZRdiTsIUIJslqjoFfk8nEAi+Bq8u/aUjrVuhZ6eZjhWRH6SC9NBA0Lwr3K35H2zDnWvK/n4vQ==","signatures":[{"sig":"MEQCIBU7VdutWDKq8tuQBguCMeEBAd5uVeaCiDVM0SYbG12dAiAZzkTm/EjKqPlVMP3FKjyNJFe4OB4kLHR4YF2SXQ7PUA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":29121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfo75ICRA9TVsSAnZWagAA2KcP/1V67IXqB1ZNZIexL2tr\nDtz0EczrJEa1i79qUezgMGDF4lYQRN16BYA5UVQxsBw6ePnXiiRIZtUrKXtz\nM2QnHFNfLDh1klEvhoYUuvJXZy11KS894m2kh1ldXOPFdHsZHnhr6byX5z+V\nyxmu45gqkYrnacJg6YoP+lV2wu38rnCAHzmyTqoTATkxuj4ujm4PG3+UkGTu\nqCiu76kFeIUHELg4uaoluxsyN+jb6peLYbRMQrHN4yrJuYgkTIxrTSw1CvCA\nyBoUO1VX9yZsfPxpDjryRYgR1vt5cyuUeeBnbn8i+gFwdqIs0ishljC8t/9M\n7w+05etLmF9tfHw3OaHzmLOaboZWxeck3k0LUVf3L38k6Mztq7fcQuwgy+8Z\nvFJ4UwLHMimk/1BpGMafHbiLJ466V+2M0JnCuFmug6VZR1DucH2WHBYDAysd\nmUZeBbLzRpCSPxtBnzTiADIGpjUVEq0o9TI4BY4YWMA3rSG/F4GG8LEGgb5/\nrW/SXjwvCf44vdXyqLsrP5icrGLBigCeW17GYZjUQJmzydK5kpdkMfZDjtqD\nB68t3TZA5yOXCci5ewyG9S1ggs3buMbKPy+ZNDlDpxPwET4UBSSpqwxRCdPn\n+AS3mhn/8cbbkYxDsn6qxioQMe+3snckGjiz8ecPiBBpRMQXCALxzMSfg63V\n/QBR\r\n=Sf4K\r\n-----END PGP SIGNATURE-----\r\n","size":7328,"noattachment":false,"key":"/jwt-decode/-/jwt-decode-3.1.1.tgz"},"main":"build/jwt-decode.cjs.js","types":"index.d.ts","module":"build/jwt-decode.esm.js","gitHead":"f87527d6e1b0281d0dc2e36c08eb1b617e048de0","scripts":{"dev":"rollup -m -c","test":"mocha","build":"rimraf build && rollup -m -c --environment NODE_ENV:production"},"_npmUser":{"name":"sambego","email":"sambellen@gmail.com"},"repository":{"url":"git://github.com/auth0/jwt-decode.git","type":"git"},"_npmVersion":"6.13.4","description":"Decode JWT tokens, mostly useful for browser applications.","directories":{},"_nodeVersion":"12.16.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^8.1.3","rimraf":"^2.2.8","rollup":"^2.26.11","expect.js":"~0.2.0","uglify-js":"^2.8.29","rollup-plugin-serve":"^1.0.4","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^15.0.0","rollup-plugin-livereload":"^2.0.0","rollup-plugin-sourcemaps":"^0.6.2","@rollup/plugin-node-resolve":"^9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/jwt-decode_3.1.1_1604566599750_0.027067023837527238","host":"s3://npm-registry-packages"},"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","publish_time":1604566599889,"_cnpm_publish_time":1604566599889,"dist-tags":{"beta":"4.0.0-beta.4","latest":"4.0.0"}}