# @qrcodesdk/core

`@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.

## Install

<PackageManagerTabs packages={['@qrcodesdk/core']} mode="add" />

## Quick start

```ts
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](/reference/renderers/svg/) for its
options and constraints.

## What Core adds

| 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](/reference/builder/). Shared visual options and scan-safety guidance live in
[Customize appearance](/guides/customize/).

## Runtime compatibility

> `@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`](/packages/browser/) | Canvas element, PNG-backed Image element, browser downloads | `HTMLCanvasElement`, `HTMLImageElement`, `void` |
| [`@qrcodesdk/node`](/packages/node/)       | PNG bytes                                                   | `Buffer`                                        |
| [`@qrcodesdk/cli`](/packages/cli/)         | Command line generation from terminals and scripts.         | Terminal text, SVG files, PNG files.            |
| [`@qrcodesdk/react`](/packages/react/)     | React SVG, Image, and Canvas components                     | React element                                   |
| [`@qrcodesdk/vue`](/packages/vue/)         | Vue SVG, Image, and Canvas components                       | Vue component                                   |
| [`@qrcodesdk/svelte`](/packages/svelte/)   | Svelte SVG, Image, and Canvas components                    | Svelte component                                |
| [`@qrcodesdk/angular`](/packages/angular/) | Angular SVG, Image, and Canvas components                   | Angular component                               |

Compare every built-in output in [Renderer outputs](/reference/renderers/).

## Public API

```ts
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.
