OneScript Docs

QRCode

Generate a QR code

Generates a PNG QR code and returns it as a File.

import { encodeQRCode } from "onescript/utils/qrcode";

const qrcode: File = await encodeQRCode("https://www.example.com");

Decode a QR code

Pass an image File. The function returns undefined when no QR code is found and throws when the image cannot be read.

import { decodeQRCode } from "onescript/utils/qrcode";

const content: string | undefined = await decodeQRCode(file);

How is this guide?

Last updated on

On this page