@omkarbhosale/upiqr
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Install the package using the following command

npm i @omkarbhosale/upiqr

Once the package is installed, you can import the library using import:

import generateQR from "@omkarbhosale/upiqr";

Example

// Import the package
import generateQR from "@omkarbhosale/upiqr";

// Async funtion is required to generate the QR and retrun the promise as Base64 URL

const qrData = async () => {
  try {
    // Get the Base64 string by using generateQR() function.
    // UPI_ID accepts the UPI ID where to recive money in
    // AMOUNT must be an integer or float.

    let data = await generateQR({ UPI_ID: "omkar@upi", AMOUNT: 1234 });

    // The above code will generate and return the Base64 Code
    console.log(data);
  } catch (error) {
    console.error("Error generating QR code:", error);
  }
};

qrData();

Authors

Package Sidebar

Install

npm i @omkarbhosale/upiqr

Version

1.0.3

License

ISC

Unpacked Size

6.87 kB

Total Files

8

Last publish

Collaborators

  • omkarbhosale