You do not need a framework to useDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Pratyay360/upiqrcode/llms.txt
Use this file to discover all available pages before exploring further.
upiqrcode. Because the package is distributed as an ES module with a bundled WebAssembly binary, you can import it directly in any JavaScript file that is processed by a WASM-capable bundler. This guide shows you how to initialize the module, generate a QR code, and display the result in the DOM — all without React or any other library.
Prerequisites: A bundler that supports WebAssembly — Vite, webpack 5, or Rollup all work. Alternatively, any browser with native ES module support can load the package directly. Node.js is not a supported environment for the default npm build; use
wasm-pack build --target nodejs if you need a Node.js build.Steps
Import and initialize
Import the default
init function and the named upiqrcode function. You must await init() before calling upiqrcode():main.js
Generate a QR code
Call
upiqrcode() with at least payeeVPA and payeeName. Both are required and have minimum length constraints (payeeVPA ≥ 5 characters, payeeName ≥ 4 characters). The function returns a promise that resolves with { qr, intent }:main.js
Bundler configuration
Different bundlers require different settings to handle WebAssembly. Choose the tab for your bundler:If you are using webpack 5, you must enable
experiments.asyncWebAssembly in your webpack.config.js. Without this flag, webpack cannot parse the .wasm binary and the import will fail at runtime.Error handling
upiqrcode() throws when required fields are missing or too short. Always wrap the call in a try/catch block:
Next steps
API reference: upiqrcode()
See the full parameter reference, return type, and validation rules for the
upiqrcode function.