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 a payload 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(payload).matrix() QRCodeMatrix
Render scalable vector output QRCodeSVGRenderer SVG string
Render terminal output QRCodeTextRenderer text string

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

Typed helpers serialize common application values before generation. See Payload helpers for email, phone, SMS, geographic, and Wi-Fi payloads.

@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 {
QRCodeBuilder,
type QRCodeCenterImageOptions,
type QRCodeColor,
type QRCodeDataImageURL,
QRCodeError,
type QRCodeErrorCode,
type QRCodeErrorCorrectionLevel,
type QRCodeFinderShape,
type QRCodeMask,
type QRCodeMatrix,
type QRCodeMatrixOptions,
type QRCodeMode,
type QRCodeModuleShape,
type QRCodePayload,
type QRCodeRenderer,
type QRCodeSVGAccessibilityOptions,
type QRCodeSVGCenterImageOptions,
type QRCodeSVGOptions,
QRCodeSVGRenderer,
type QRCodeSVGRendererOptions,
type QRCodeTextANSIBackgroundOptions,
type QRCodeTextANSIOptions,
QRCodeTextRenderer,
type QRCodeTextRendererOptions,
type QRCodeTextStyle,
type QRCodeVersion,
type QRCodeVisualStyle,
createQRCodeStyler,
qrcode,
} from '@qrcodesdk/core';
import type {
QRCodeStyledDrawing,
QRCodeStyledDrawingTarget,
QRCodeStyler,
} from '@qrcodesdk/core/drawing';
import {
type QRCodeEmailPayload,
type QRCodeGeoPayload,
type QRCodePhonePayload,
type QRCodeSMSPayload,
type QRCodeWiFiEncryption,
type QRCodeWiFiPayload,
emailPayload,
geoPayload,
phonePayload,
smsPayload,
wifiPayload,
} from '@qrcodesdk/core/payload';

Drawing types and payload helpers are deliberately not re-exported from the package root. Import them from the stable subpath entry points shown above.

Output is deterministic for one installed implementation, but matrix modules, SVG markup, and PNG bytes may change between QRCodeSDK releases. Pin exact package versions and keep fixtures when exact artifacts matter. See the version and output policy.