Skip to content

QRCodeSDK

Generate QR codes from one TypeScript builder, then choose the output format your app needs.

QRCodeSDK separates QR code generation from output. Start with qrcode(), then render SVG, PNG, Canvas, Image elements, terminal text, matrix data, or your own custom format.

  1. Install @qrcodesdk/core.

    Terminal window
    pnpm add @qrcodesdk/core
  2. Render your first QR code.

    import {SVGQRCodeRenderer, qrcode} from '@qrcodesdk/core';
    const svg = qrcode('https://qrcodesdk.dev').render(SVGQRCodeRenderer());

SVG is the best default for most user-facing QR codes because it stays sharp at any size and works in browsers, servers, emails, and static assets.

Most renderers use the same styling options.

import {SVGQRCodeRenderer, qrcode} from '@qrcodesdk/core';
const svg = qrcode('https://qrcodesdk.dev')
.errorCorrection('H')
.render(
SVGQRCodeRenderer({
size: 8,
margin: 4,
colors: {
colorDark: '#111827',
colorLight: '#ffffff',
},
ariaLabel: 'Scan to open qrcodesdk.dev',
}),
);