Choose your setup
Install the smallest set of packages that gives you the output you need. Start with Core if SVG or terminal text is enough. Every other package builds on it.
Choose a package
Section titled “Choose a package”| Package | Choose it for | Outputs |
|---|---|---|
@qrcodesdk/core |
Runtime-neutral generation and raw matrix access | SVG string, terminal text string, QRCodeMatrix |
@qrcodesdk/browser |
Direct DOM output and client-side downloads | HTMLCanvasElement, PNG, WebP, GIF, or JPEG HTMLImageElement, SVG or image download |
@qrcodesdk/node |
Server-side raster output | PNG, WebP, GIF, or JPEG Buffer |
@qrcodesdk/react |
React and Next.js components | QRCodeSVG, QRCodePNG, QRCodeWebP, QRCodeGIF, QRCodeJPEG, QRCodeCanvas, downloads |
@qrcodesdk/react-native |
React Native and Expo components | QRCodeSVG, QRCodePNG, QRCodeWebP, QRCodeGIF, QRCodeJPEG |
@qrcodesdk/vue |
Vue components | QRCodeSVG, QRCodePNG, QRCodeWebP, QRCodeGIF, QRCodeJPEG, QRCodeCanvas, downloads |
@qrcodesdk/svelte |
Svelte components | QRCodeSVG, QRCodePNG, QRCodeWebP, QRCodeGIF, QRCodeJPEG, QRCodeCanvas, downloads |
@qrcodesdk/angular |
Standalone Angular components | QRCodeSVG, QRCodePNG, QRCodeWebP, QRCodeGIF, QRCodeJPEG, QRCodeCanvas, downloads |
@qrcodesdk/cli |
Terminal, shell, and CI workflows | Terminal text, SVG, PNG, WebP, GIF, or JPEG file |
- Compare outputs and exact return types in Renderer outputs.
- Compare QRCodeSDK with other libraries in Compare with other libraries.
Install Core
Section titled “Install Core”For SVG, terminal text, or raw matrix output.
npm install @qrcodesdk/corepnpm add @qrcodesdk/corevp add @qrcodesdk/coredeno add npm:@qrcodesdk/corebun add @qrcodesdk/coreyarn add @qrcodesdk/coreInstall browser output
Section titled “Install browser output”For Canvas elements, PNG, WebP, GIF, and JPEG Image elements, and browser downloads.
npm install @qrcodesdk/core @qrcodesdk/browserpnpm add @qrcodesdk/core @qrcodesdk/browservp add @qrcodesdk/core @qrcodesdk/browserdeno add npm:@qrcodesdk/core npm:@qrcodesdk/browserbun add @qrcodesdk/core @qrcodesdk/browseryarn add @qrcodesdk/core @qrcodesdk/browserInstall Node.js PNG, WebP, GIF, and JPEG output
Section titled “Install Node.js PNG, WebP, GIF, and JPEG output”Requires Node.js 22.0.0 or newer.
npm install @qrcodesdk/core @qrcodesdk/nodepnpm add @qrcodesdk/core @qrcodesdk/nodevp add @qrcodesdk/core @qrcodesdk/nodedeno add npm:@qrcodesdk/core npm:@qrcodesdk/nodebun add @qrcodesdk/core @qrcodesdk/nodeyarn add @qrcodesdk/core @qrcodesdk/nodeInstall React components
Section titled “Install React components”npm install @qrcodesdk/reactpnpm add @qrcodesdk/reactvp add @qrcodesdk/reactdeno add npm:@qrcodesdk/reactbun add @qrcodesdk/reactyarn add @qrcodesdk/reactReact and React DOM are peer dependencies. Keep the versions your app already uses.
Next.js Server Components that import style factories also need Core as a direct dependency. See Add Core to a framework project and Next.js client boundary.
Install React Native components
Section titled “Install React Native components”npm install @qrcodesdk/react-native react-native-svgpnpm add @qrcodesdk/react-native react-native-svgvp add @qrcodesdk/react-native react-native-svgdeno add npm:@qrcodesdk/react-native npm:react-native-svgbun add @qrcodesdk/react-native react-native-svgyarn add @qrcodesdk/react-native react-native-svgReact Native 0.79 or newer, React, and react-native-svg are peer dependencies. In an Expo app,
install react-native-svg with npx expo install react-native-svg.
Install Vue components
Section titled “Install Vue components”npm install @qrcodesdk/vuepnpm add @qrcodesdk/vuevp add @qrcodesdk/vuedeno add npm:@qrcodesdk/vuebun add @qrcodesdk/vueyarn add @qrcodesdk/vueVue 3 is a peer dependency. Keep the version your app already uses.
Install Svelte components
Section titled “Install Svelte components”npm install @qrcodesdk/sveltepnpm add @qrcodesdk/sveltevp add @qrcodesdk/sveltedeno add npm:@qrcodesdk/sveltebun add @qrcodesdk/svelteyarn add @qrcodesdk/svelteSvelte 5 is a peer dependency. Keep the version your app already uses.
Install Angular components
Section titled “Install Angular components”npm install @qrcodesdk/angularpnpm add @qrcodesdk/angularvp add @qrcodesdk/angulardeno add npm:@qrcodesdk/angularbun add @qrcodesdk/angularyarn add @qrcodesdk/angular@angular/core and @angular/common are peer dependencies. Angular 20, 21, and 22 are supported.
Keep the versions your app already uses.
Install the CLI
Section titled “Install the CLI”Requires Node.js 22.12.0 or newer.
npm install -g @qrcodesdk/clipnpm add -g @qrcodesdk/clivp install -g @qrcodesdk/clideno install --global --allow-read --allow-write --allow-env --name qrc npm:@qrcodesdk/clibun add -g @qrcodesdk/cliYarn 2 and newer have no global install. Add the CLI to a project or run it with yarn dlx. See
Install on the CLI page.
Add Core to a framework project
Section titled “Add Core to a framework project”The React, React Native, Vue, Svelte, and Angular packages depend on Core. They re-export:
- shape and center-image factories
automaticSegmenterand thekanjitablemicroQR()andrMQR()- the payload helpers, such as
wifiPayload() - types
They do not re-export qrcode() or QRCodeError.
Add Core as a direct dependency when you need those, or when Next.js Server Components import style
factories from @qrcodesdk/core/style. Your app can only import packages it declares.
Install the same Core version your framework package uses:
- Run
npm ls @qrcodesdk/coreorpnpm why @qrcodesdk/core. Note the version listed under your framework package, such as@qrcodesdk/react. - Install exactly that version with
npm install --save-exact @qrcodesdk/core@<version>orpnpm add --save-exact @qrcodesdk/core@<version>. - Run the first command again. It should list a single Core version.
Repeat these steps whenever you upgrade the framework package.
Matching versions keep a single copy of Core installed. With two copies:
- shapes from one copy can draw incorrectly in the other,
- renderers ignore center images created by the other copy,
instanceof QRCodeErrorfails.
Module format
Section titled “Module format”Every QRCodeSDK package is ES modules only. There is no CommonJS build.
| Your code | How to load QRCodeSDK |
|---|---|
| ES modules, TypeScript, bundlers | import |
| CommonJS on Node.js 22.12 or newer | require() or dynamic import() |
| CommonJS on older Node.js | Dynamic import(); require() throws ERR_REQUIRE_ESM |
A dynamic import() works in CommonJS on every supported Node.js version:
// CommonJS module, such as index.cjsasync function main() { const {QRCodeSVGRenderer, qrcode} = await import('@qrcodesdk/core'); console.log(qrcode('https://qrcodesdk.dev').render(QRCodeSVGRenderer()));}
main();TypeScript with module: 'commonjs' rewrites import() to require(). Use module: 'node16' or
'nodenext' to keep the dynamic import. See
Core runtime compatibility.
Next steps
Section titled “Next steps”- Open your package’s page from the table above for a minimal example.
- Using Core? Continue with the SVG string renderer.
- Want a working example for every stack? See Start with your stack.
Support QRCodeSDK
If you find QRCodeSDK useful, please consider sponsoring the project!