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:
| Option | Type | Description |
|---|---|---|
| content | string | The content of the QRCode. |
| lightColor | string | Used as the background of the QRCode. |
| darkColor | string | Used for the symbols inside of the QRCode. |
| margin | number | The offset around the QRCode. |
| width | number | The width of the QRCode. |
Output
The SDK will return a Blob as result.
