{"repo":"auth0/jwt-decode","free":true,"listed":false,"github":"https://github.com/auth0/jwt-decode","clone":"git clone https://github.com/auth0/jwt-decode.git","description":"Decode JWT tokens; useful for browser applications.","language":"TypeScript","stars":3396,"topics":["jwt","dx-sdk"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"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, koa-jwt, Microsoft.AspNetCore.Authentication.JwtBearer, etc. :books: Documentation - :rocket: Getting Started - :speech balloon: Feedback Documentation - Docs site - explore our docs site and learn more about Auth0. Getting started Installation Install with NPM or Yarn. Run npm install jwt-decode or yarn add jwt-decode to install the library. Usage Note: A falsy or malformed token will throw an InvalidTokenError error; see below for more information on specific errors. Polyfilling atob This library relies on atob() , which is a global function available on all modern browsers as well as every supported node environment. In order to use jwt-decode in an environment that has no access to atob() (e.g. React Native prior to version 0.74), ensure to provide the corresponding polyfill in your application by using core-js/stable/atob : Alternatively, you can also use base-64 and polyfill global.atob yourself: Errors This library works with valid JSON web tokens. The basic format of these token is All parts are supposed to be valid base64 (url) encoded json. Depending on the { header: } option it will decode part 1 (only if header: true is specified) or part 2 (default) Not adhering to the format will result in a InvalidTokenError with one of the following messages: - Invalid token specified: must be a str","default_branch":null,"files":null,"tree":[],"storefront":"/r/auth0","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/auth0/jwt-decode/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."}