{"repo":"nestjs/jwt","free":true,"listed":false,"github":"https://github.com/nestjs/jwt","clone":"git clone https://github.com/nestjs/jwt.git","description":"JWT utilities module based on the jsonwebtoken package 🔓","language":"TypeScript","stars":687,"topics":["nestjs","nest","nodejs","jsonwebtoken","jwt","javascript","typescript"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master [travis-url]: https://travis-ci.org/nestjs/nest [linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux [linux-url]: https://travis-ci.org/nestjs/nest A progressive Node.js framework for building efficient and scalable server-side applications. Description JWT utilities module for Nest based on the jsonwebtoken package. Installation Usage Import JwtModule : Inject JwtService : Secret / Encryption Key options If you want to control secret and key management dynamically you can use the secretOrKeyProvider function for that purpose. You also can use asynchronous version of secretOrKeyProvider . NOTE: For asynchronous version of secretOrKeyProvider , synchronous versions of .sign() and .verify() will throw an exception. Async options Quite often you might want to asynchronously pass your module options instead of passing them beforehand. In such case, use registerAsync() method, that provides a couple of various ways to deal with async data. 1. Use factory Obviously, our factory behaves like every other one (might be async and is able to inject dependencies through inject ). 2. Use class Above construction will instantiate JwtConfigService inside JwtModule and will leverage it to create options object. 3. Use existing It works the same as useClass with one critical difference - JwtModule will lookup imported modules to reuse already created ConfigService , instead of instantiating it o","default_branch":null,"files":null,"tree":[],"storefront":"/r/nestjs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/nestjs/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."}