Before we begin, what around JSON Web Tokens (Otherwise known as JWT)? JWT is a signed key that contains basic data that helps the server to identify if users are logged in or not, and who they are logged in as.
You can read into more specifically how JWT works here: JSON Web Token Introduction.
Using JWT with Node.JS
First of all, install jsonwebtoken
:
npm install jsonwebtoken --save # JS
npm install jsonwebtoken @types/jsonwebtoken --save-dev # TS
pnpm add jsonwebtoken # JS
pnpm add jsonwebtoken @types/jsonwebtoken # TS
yarn add jsonwebtoken # JS
yarn add jsonwebtoken @types/jsonwebtoken # TS
More will come later
Discover more from WTDawson
Subscribe to get the latest posts sent to your email.