Skip to content

@xtandard/links/qr

QR codes for short links: renderQrSvg renders any text as a crisp, scalable SVG (one <path>, shape-rendering="crispEdges"), and qrUrl builds the URL a link’s QR code should encode — its short URL with ?qr=1, so scans are counted as qr: true clicks and the qr rule condition can route them.

Encoding is done by the tiny, zero-dependency uqr package; works in every runtime (browser, edge, Node, Bun).

import { … } from "@xtandard/links/qr";
Name Summary
qrUrl The URL a link’s QR code encodes: its short URL with ?qr=1 (counted as a QR scan).
renderQrSvg Render text as a QR code SVG string.
shortUrl The public short URL of a link (https://go.acme.com/launch).
Name Summary
QrSvgOptions Options for renderQrSvg.
ShortUrlOptions Options for shortUrl and qrUrl.
Name Summary
QrEcc Error-correction level: recovers ~7% (L), 15% (M), 25% (Q) or 30% (H) damage.