Generate QR Code
AI-generatedOverview
This node generates QR Codes for various content types including plain text or URLs, Brazilian PIX payment data, WiFi network credentials, and contact information in vCard format. It is useful for creating QR codes that can be scanned to quickly share information such as payment details, WiFi access, or contact cards. For example, a user can generate a QR code for a WiFi network to allow guests to connect easily, or create a PIX payment QR code for quick transactions.
Use Case Examples
- Generate a QR code from a URL to share a website link.
- Create a PIX payment QR code with merchant details and amount for easy payment.
- Generate a WiFi QR code with network name and password for guest access.
- Create a vCard QR code containing contact information for quick sharing.
Properties
| Name | Meaning |
|---|---|
| Content Type | Type of content to encode in the QR Code, such as text, PIX payment, WiFi credentials, or vCard contact information. |
| Content | The text or URL to encode in the QR Code (used when Content Type is Text/URL). |
| PIX Key | PIX key for the payment, such as CPF, CNPJ, email, phone, or random key (used when Content Type is PIX Payment). |
| Merchant Name | Name of the merchant or person receiving the payment (used when Content Type is PIX Payment). |
| Amount | Payment amount; leave 0 for variable amount (used when Content Type is PIX Payment). |
| City | City where the transaction takes place (used when Content Type is PIX Payment). |
| Transaction ID | Optional transaction identifier (used when Content Type is PIX Payment). |
| Network Name (SSID) | WiFi network name (used when Content Type is WiFi Network). |
| Password | WiFi network password (used when Content Type is WiFi Network). |
| Security Type | WiFi security type such as WPA/WPA2, WEP, or None (used when Content Type is WiFi Network). |
| Full Name | Contact full name (used when Content Type is Contact vCard). |
| Phone | Contact phone number (used when Content Type is Contact vCard). |
| Contact email address (used when Content Type is Contact vCard). | |
| Organization | Contact organization (used when Content Type is Contact vCard). |
| Options | Additional options for QR code generation such as output format, size, error correction level, margin, and colors. |
Output
Binary
Binary PNG image data of the generated QR code (if output format is Buffer).
JSON
qrCode- The generated QR code in the selected output format (Base64 Data URL, Base64 String, or Buffer placeholder).content- The raw content string encoded in the QR code.contentType- The type of content encoded in the QR code (text, pix, wifi, or vcard).options- The options used for generating the QR code, including format, size, colors, and error correction level.
Dependencies
- qrcode library for QR code generation
Troubleshooting
- Error if required fields for PIX, WiFi, or vCard content types are missing (e.g., PIX Key, Merchant Name, City for PIX; SSID for WiFi; Contact name for vCard).
- Error if content is empty or unknown content type is specified.
- Error if unknown output format is selected.