Skip to content

thai-qr-payment

Spec-faithful Thai QR Payment for JS — payload, QR, SVG card, React, CLI. Zero deps.

Every other Thai QR library on npm wraps the qrcode package, ties you to Node-only APIs, or ships a 30 KB blob. This one is in-house TypeScript end-to-end:

Zero runtime deps

No qrcode, no canvas, no crc16. npm install thai-qr-payment pulls one tarball.

Universal

Browsers, Node ≥ 18, Bun, Deno, Cloudflare Workers, Vercel Edge — same bundle.

Tiny

Full bundle 13.6 KB brotli. Payload-only sub-path 3 KB.

Spec-faithful

EMVCo MPM 1.1 + Bank of Thailand supplement, ISO/IEC 18004 QR Model 2, 337 vitest tests in the payload package alone.

React-ready

<ThaiQRPayment /> and <ThaiQRPaymentMatrix /> SSR-safe, peer-dep React.

CLI included

npx thai-qr-payment 0812345678 --amount 50 -o qr.svg

example.ts
import { renderThaiQRPayment } from 'thai-qr-payment';
const svg = renderThaiQRPayment({
recipient: '0812345678',
amount: 50,
merchantName: 'Acme Coffee',
amountLabel: '฿ 50.00',
errorCorrectionLevel: 'H',
});

Sample QR card output

→ Try it without installing