Changelog
0.0.6 Latest
Patch Changes
-
61b4d56: Add opt-in QR code Kanji mode, which packs each double-byte Shift JIS character into 13 bits instead of UTF-8 bytes, so Japanese text fits smaller symbols. Import the Shift JIS table from the new
@qrcodesdk/core/kanjientry point and pass it as thekanjimatrix option or with.kanji(kanji). The table adds about 13 kB gzipped and stays out of bundles that don’t import it.With the table,
mode: 'kanji'forces Kanji mode,automode picks Kanji mode when every character fits, andautomaticSegmentercombines Kanji segments with numeric, alphanumeric, and octet segments. Custom segmenters receive the table askanjiin their options and can return{mode: 'kanji'}segments. Kanji mode only accepts characters that decode back unchanged, and Kanji segments never get an ECI header.Kanji mode or Kanji segments without the table throw
QRCodeErrorwith codeINVALID_OPTIONS; characters outside the table throwINVALID_PAYLOAD.QRCodeEncodingModeandQRCodeModenow include'kanji', so exhaustiveswitchstatements over them need a new case. The newQRCodeKanjitype describes the table. -
0d39229: Add Micro QR codes (M1 to M4) through the new
@qrcodesdk/core/microentry point. PassmicroQR()as thesymbolmatrix option, such asqrcode('12345').options({symbol: microQR()}), to generate the smallest Micro QR code that holds the payload.microQR()acceptsversion('M1'to'M4'),mask(0to3), andfallback, which generates a standard QR code when no Micro QR code can hold the payload. Applications that do not import@qrcodesdk/core/microdo not bundle the Micro QR encoder.Micro QR codes support numeric, alphanumeric, octet, and, with the
kanjitable from@qrcodesdk/core/kanji, Kanji mode in M3 and M4. They support levelsLandM, andQin M4. M1 only detects errors, so it is used only when requested withversion: 'M1'. Settingversion,mask,eci, orsegmenternext to a Micro QR symbol throwsQRCodeErrorwith codeINVALID_OPTIONS.QRCodeMatrixOptionsis now the union ofQRCodeStandardMatrixOptionsandQRCodeSymbolMatrixOptions. Interfaces can no longer extendQRCodeMatrixOptions; extendQRCodeStandardMatrixOptionsinstead, and use it when deriving types withOmitorPick. Add theQRCodeSymbol,QRCodeMicroVersion,QRCodeMicroMask, andQRCodeMicroOptionstypes.The default
style.quietZoneof the built-in renderers is now 2 modules for Micro QR codes and stays 4 modules for standard QR codes.finder()styles only the finder patterns that a symbol contains. -
cb8c78a: Add the
vcardPayload()andcalendarPayload()payload helpers to@qrcodesdk/core/payload.vcardPayload()serializes a contact as a vCard 3.0 payload with a formatted name and optional structured name, organization, title, phones, emails, addresses, URL, and note.calendarPayload()serializes an event as an iCalendar 2.0VEVENTwith a UID, timestamp, summary, start, end, and optional location, description, and URL. SetallDay: trueto passYYYY-MM-DDdates instead of date-times; the end is exclusive.Both helpers escape text values, fold long lines, and throw
QRCodeErrorwith codeINVALID_PAYLOADfor invalid fields, such as line breaks in single-line fields, unsupported control characters, non-HTTP(S) URLs, date-times without seconds or an explicit offset, or an end that is not later than the start. Errors for nested fields use paths such asaddresses[0].postalCodeindetails.field. URL fields require the standardURLAPI. Add theQRCodeVCardPayload,QRCodeVCardName,QRCodeVCardPhone,QRCodeVCardEmail,QRCodeVCardAddress, andQRCodeCalendarPayloadtypes. -
526d0e6: Breaking:
QRCodeMatrixdescribes its dimensions withwidth(modules per row) andheight(rows) instead ofsize. Standard and Micro QR matrices are square, so both values are equal, and the module at columnxand rowyis at indexy * width + x. Replacematrix.sizewithmatrix.width, and loop overheightfor rows in custom renderers so they also draw rectangular symbols.The SVG and text renderers draw rectangular matrices, the default
style.quietZoneis 2 modules for every symbol shorter than 21 modules, and a center image is a square sized from the shorter side of the symbol and centered on both axes. Thedimensionscheck of the built-in renderers applies to the output width and height separately. -
526d0e6: Add rectangular Micro QR (rMQR) codes (ISO/IEC 23941) through the new
@qrcodesdk/core/rmqrentry point. PassrMQR()as thesymbolmatrix option, such asqrcode('LOT-2026-0042').options({symbol: rMQR()}), to generate the rMQR code with the fewest modules that holds the payload.rMQR({version: 'R7'})selects the narrowest code of a height, from'R7'to'R17', andrMQR({version: 'R7x59'})selects an exact version, from'R7x43'to'R17x139'. Applications that do not import@qrcodesdk/core/rmqrdo not bundle the rMQR encoder.rMQR codes are 7 to 17 modules high and 27 to 139 modules wide and hold up to 361 digits, 219 alphanumeric characters, 150 bytes, or 92 Kanji characters. They encode one numeric, alphanumeric, octet, or, with the
kanjitable, Kanji segment at the error-correction levelsMandH. LevelsLandQ, andversion,mask,eci, orsegmenternext to an rMQR symbol, throwQRCodeErrorwith codeINVALID_OPTIONS. Add theQRCodeRMQRVersion,QRCodeRMQRHeight, andQRCodeRMQROptionstypes.rMQR codes reuse the standard module roles: the finder sub-pattern has the alignment roles, so
alignment()styles it, and it stays square whenmoduleshas a shape, because scanners locate the code with it.
0.0.5
Patch Changes
-
15fe5c3: Reduce the default center image
sizefrom0.4to0.3of the matrix width. Passsize: 0.4in the center image layout to keep the previous size. -
2fd183e: Replace the nested-array matrix with an immutable
QRCodeMatrixobject containingsize, flat row-majormodules, androles. Custom renderers must read a module atmodules[y * size + x]. UseQR_CODE_MODULE_ROLESto distinguish data, finder, alignment, timing, and information modules.Replace string-based module and finder shapes with reusable
rounded(),diagonal(),circle(),finder(),alignment(), andcustomShape()factories from@qrcodesdk/core/style. Finder options now useringinstead ofouter. Add independent alignment styling and custom relative SVG paths. Remove the public@qrcodesdk/core/drawingentry point and drawing protocol; custom renderers consume the matrix directly.Create SVG center images with
svgCenterImage(source, layout)and pass the result ascenterImage, replacing inline source and layout objects. ReplaceQRCodeSVGCenterImageOptionswithQRCodeSVGCenterImageand useQRCodeCenterImageLayoutfor shared layout options.Speed up matrix encoding, error correction, masking, and scoring. Reduce repeated shape preparation and drawing allocations, group output by color, and compact SVG paths. Keep the matrix entry point independent of styling code so unused styling stays out of consumer bundles.
Rely on the declared TypeScript types for option object shapes and payload helper input types. Unknown option keys and incorrectly typed values no longer consistently produce
QRCodeError; numeric bounds, colors, image sources, and custom paths still receive runtime validation. -
21107ab: Add bundled lossless WebP, single-frame GIF, and baseline JPEG encoders for the
@qrcodesdk/browserand@qrcodesdk/nodeimage renderers. The encoders run without platform image APIs, so output is identical in every browser and in Node.
0.0.4
Patch Changes
-
Refreshed the package READMEs with clearer option examples and consolidated links to the documentation guides.
-
createQRCodeStyleris no longer exported from the@qrcodesdk/coreroot entrypoint. Import it from@qrcodesdk/core/drawinginstead:import {createQRCodeStyler} from '@qrcodesdk/core/drawing'; -
Fixed the
extra-roundedfinder styling. The finder ring now keeps straight edges and a consistent one-module thickness around its corners in SVG, canvas, image, and PNG output.
0.0.3
Patch Changes
-
Added subpath entrypoints for direct runtime imports without a bundler:
@qrcodesdk/core/matrix,@qrcodesdk/core/svg,@qrcodesdk/core/text, and@qrcodesdk/core/erroras well as@qrcodesdk/browser/canvas,@qrcodesdk/browser/image, and@qrcodesdk/browser/svg.@qrcodesdk/core/drawingnow also exportscreateQRCodeStyler. The root entrypoints keep exporting the same APIs and the runtime bundles are smaller. -
Removed
cubicTofromQRCodeStyledDrawingTarget. The styler no longer emits cubic curves, so custom drawing targets no longer need to implement it. -
Hardened input validation:
qrcode(...).matrix()now returns a frozen matrix.- Payloads that are neither a string nor a number are rejected with
INVALID_PAYLOAD. - The payload helpers (
emailPayload,phonePayload,smsPayload,geoPayload,wifiPayload) reject non-object input, non-list recipients, non-string phone extensions and SMS bodies, and phone numbers without digits. - The SVG renderer rejects
accessibility.ariaLabel,accessibility.title, and center image sources that contain characters that are invalid in XML. - The text renderer validates the
ansioption and itsmode,foreground, andbackgroundfields, and matrix option errors report the rejected field and value.
0.0.2
Patch Changes
- 210c615: Replace the renderer and styling APIs with the new
matrix,style,accessibility, andimageoption groups. Rename visual styling types, renderer image options, and CLI flags to match the new vocabulary. Add@qrcodesdk/core/payloadfor payload helpers, expose them from the core entry point, and improve rendering performance across SVG, canvas, and PNG output. - 358292a: Generate smaller QR codes for mixed input by automatically splitting data into optimized numeric, alphanumeric, and byte segments. Add optional UTF-8 ECI encoding through the core options, builder API, and the CLI’s
--eciflag. - 358292a: Improve rendered output accessibility and browser reliability. SVG output now uses valid title and ARIA markup, canvases can receive accessible labels, images default to an empty alt attribute, SVG download URLs remain alive until the download starts, and Angular SVG downloads safely no-op during server rendering.
- 358292a: Tighten package export surfaces by marking cross-package implementation types as internal, using explicit Angular component exports, and emitting React’s shared interfaces as type-only exports. React components now also use the platform’s native child replacement API.
- 358292a: Refresh generated package READMEs with clearer setup, renderer, customization, download, and runtime guidance. Expand the Angular peer range to support Angular 20 through 22.
- 358292a: Improve SVG, canvas, image, and PNG rendering performance by reusing resolved styling, grouping drawing work into color layers, compacting square modules, and reducing repeated allocation and encoding work.
0.0.1
Patch Changes
- Initial release
Support QRCodeSDK
If you find QRCodeSDK useful, please consider sponsoring the project!