Build a script that signs JSON Web Tokens in Postman.
Build the Postman script by running this command, which also installs node modules:
npm run start
The built Postman script is at dist/pre-request-script.js
.
Copy the content of this file and paste it into Postman's Pre-request Script panel. Notice that it sets a Postman environment variable named bearerToken
.
If you're on macOS copy the script to the Clipboard with this Terminal command:
pbcopy < dist/pre-request-script.js
Over in the Headers panel, add a header key Authorization
whose value is Bearer {{bearerToken}}
.