How to generate QR codes using TTA in Directus hooks.

Using QRCodes inside of Directus Flows
Use TTA's QRcode operation to integrate QRcode generation into Directus Flows.
It creates a QRCode that works with:
- URL`s
- Plain text
- Email addresses
- Phone numbers
- Ect.
Operation Settings

Inside of the operation you have the following options:
Option | Description |
---|---|
QRCode content | The content of the QRCode. |
Light color | Used as the background of the QRCode. |
Dark color | Used for the symbols inside of the QRCode. |
Margin | The offset around the QRCode. |
Width | The width of the QRCode. |
Output
The output of the operation is a file ID. The file will be placed on the root folder. You can use this ID to update the image with the correct folder/name ect or you can use it in any image field in Directus.
Generating barcodes in your own Directus extension
const fileID = await globalThis.TTA.generateQRCode({
'content': 'Your barcode content!',
'darkColor': 'fff',
'lightColor': '000',
'margin': 2,
'width': 200
});
Inside of the operation you have 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 output of the operation is a file ID. The file will be placed on the root folder. You can use this ID to update the image with the correct folder/name ect or you can use it in any image field in Directus.