You can generate a QR code in your Node.js app using the ‘qrcode‘ library. One common application of server-side QR code generation is to help users set up two-factor authentication (2FA).
Other common applications:
- QR code menus for restaurants.
- QR code social media links: Not having to search for a company’s social media page. Visitors can just scan your QR code and to bring up your Instagram profile.
const QR = require("qrcode");
QR.toString('https://www.kompulsa.com',{type:'terminal'}, function (err, data) {
console.log(data);
});
The example above will display the QR code format of your data in a terminal window.