aboutsummaryrefslogtreecommitdiffstats
path: root/src/qr.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/qr.js')
-rw-r--r--src/qr.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qr.js b/src/qr.js
index eab74a7..fe49a02 100644
--- a/src/qr.js
+++ b/src/qr.js
@@ -3,8 +3,11 @@
import qrcode from 'qrcode-generator';
-export function qrSvg(text, { margin = 2 } = {}) {
- const qr = qrcode(0, 'M'); // type 0 = auto-size, error correction M
+// ec: error-correction level. 'M' by default; pass 'L' for long payloads (e.g.
+// gift links) where a smaller, chunkier grid scans more easily — on-screen QRs
+// are scanned immediately and don't need the damage tolerance of higher levels.
+export function qrSvg(text, { margin = 2, ec = 'M' } = {}) {
+ const qr = qrcode(0, ec); // type 0 = auto-size
qr.addData(text);
qr.make();