Skip to content

Instantly share code, notes, and snippets.

@enricobottazzi
Last active July 11, 2022 12:58
Show Gist options
  • Save enricobottazzi/9d31cafe2a1841dbe6acb9f079957e94 to your computer and use it in GitHub Desktop.
Save enricobottazzi/9d31cafe2a1841dbe6acb9f079957e94 to your computer and use it in GitHub Desktop.
Create QR Code
// el is the HTML DOM element into which the generated QR Code will be added
// data is the auth reponse (or any information) that has to be rendered inside the QR Code
function makeQr(el, data) {
return new QRCode(el, {
text: JSON.stringify(data),
width: 300,
height: 300,
colorDark: "#000",
colorLight: "#e9e9e9",
correctLevel: QRCode.CorrectLevel.H
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment