QR Code Generation in Javascript

How to generate QR codes using TTA in Javascript.

Generate QR Codes in Javascript

import { TextToAnything } from "@texttoanything/nodets";

const TTA = new TextToAnything(/*API token here*/);

const qrcodeFile = await TTA.generateQRCode("qrcode.png", {
  content: "https://rapidapi.com/Attacler/api/text-to-anything",
});

The object has the following options:

OptionTypeDescription
contentstring The content of the QRCode.
lightColorstring Used as the background of the QRCode.
darkColorstring Used for the symbols inside of the QRCode.
marginnumber The offset around the QRCode.
widthnumber The width of the QRCode.

Output

The SDK will return a Blob as result.