Skip to content

@qrcodesdk/core

Open @qrcodesdk/core on npmx.dev@qrcodesdk/core version@qrcodesdk/core install size@qrcodesdk/core bundled size@qrcodesdk/core download/mo@qrcodesdk/core source code
works with
This package works with googlechrome
This package works with firefox
This package works with safari
This package works with node
This package works with bun
This package works with deno

@qrcodesdk/core is the runtime-neutral foundation of QRCodeSDK. It turns data into a QR code matrix and lets renderers decide how that matrix becomes SVG, terminal text, PNG, DOM output, or any custom format.

Terminal window
npm install @qrcodesdk/core
import {QRCodeSVGRenderer, qrcode} from '@qrcodesdk/core';
const svg = qrcode('https://qrcodesdk.dev').render(QRCodeSVGRenderer());

The result is an SVG string. See the SVG renderer reference for its options and constraints.

Capability API Return type
Generate a QR matrix qrcode(data).matrix() QRCodeMatrix
Render scalable vector output QRCodeSVGRenderer SVG string
Render terminal output QRCodeTextRenderer text string

The complete input, matrix-option, builder-method, and matrix-output contracts live in Builder and matrix. Shared visual options and scan-safety guidance live in Customize appearance.

@qrcodesdk/core supports any JavaScript runtime providing native ESM, ES2020 support, and a global TextEncoder. It has no Node.js, DOM, filesystem, or framework dependency.

Runtime Support policy
Node.js All maintained LTS lines
Deno Current stable major
Bun Current stable release
Browsers Current evergreen browser families
Other runtimes and edge workers Supported when they meet the Core runtime contract

For runtime-specific output, add the owning package:

Package Additional output Output
@qrcodesdk/browser Canvas element, PNG-backed Image element, browser downloads HTMLCanvasElement, HTMLImageElement, void
@qrcodesdk/node PNG bytes Buffer
@qrcodesdk/cli Command line generation from terminals and scripts. Terminal text, SVG files, PNG files.
@qrcodesdk/react React SVG, Image, and Canvas components React element
@qrcodesdk/vue Vue SVG, Image, and Canvas components Vue component
@qrcodesdk/svelte Svelte SVG, Image, and Canvas components Svelte component
@qrcodesdk/angular Angular SVG, Image, and Canvas components Angular component

Compare every built-in output in Renderer outputs.

import {
type QRCodeAccessibilityOptions,
QRCodeBuilder,
type QRCodeColorHex,
type QRCodeCornerDotType,
type QRCodeCornerSquareType,
type QRCodeCornersDotOptions,
type QRCodeCornersSquareOptions,
type QRCodeDataImageURL,
type QRCodeDotType,
type QRCodeDotsOptions,
type QRCodeErrorCorrectionLevel,
type QRCodeImageOverlayOptions,
type QRCodeInputData,
type QRCodeMask,
type QRCodeMatrix,
type QRCodeMatrixOptions,
type QRCodeMode,
type QRCodeOptions,
type QRCodeRenderer,
type QRCodeSVGImageOptions,
type QRCodeSVGOptions,
QRCodeSVGRenderer,
type QRCodeSVGRendererOptions,
type QRCodeStylingColors,
type QRCodeStylingOptions,
QRCodeTextRenderer,
type QRCodeTextRendererOptions,
type QRCodeVersion,
qrcode,
} from '@qrcodesdk/core';

Exports whose names begin with ɵ are private integration contracts for QRCodeSDK sibling packages. They are not part of the public API and can change without compatibility guarantees.