OneScript Docs

Utils

Utility APIs.

$qrcode.encode(text)

Encodes a non-empty string as a QR code image and returns an internal image token.

Use the returned token as the image value in an image Widget view node.

const image = $qrcode.encode("https://example.com")

$widget.setTimeline(() => {
  return {
    type: "image",
    props: {
      image,
      resizable: true,
      scaledToFit: true,
      padding: 12
    }
  }
})

text must be a non-empty string. Empty strings and non-string values throw $qrcode.encode requires a non-empty string.

How is this guide?

Last updated on

On this page