# QRCode

Category: Automation
|
Runtime: 0.9+
|
Available: Free

# Overview

QRCode node helps in generating QRCode for a given string content. The node generates a base64 encoded png url.

# Setup

# Prerequisites

Not applicable

# Installation

To install the node from designer:

  1. Go to Add more nodes option on the palette section.
  2. Check for the QRCode node and click install.
  3. Once installed, the designer is required to be restarted.

To install the node from CLI:

  1. Go to your project workspace where you can see your package.json file.
  2. Run the below give npm command.
    npm i @kumologica/kumologica-contrib-qrcode

# Technical Details

Properties

  • QR String (Required)
    String content for which you need to generate the QRCode.
  • Margin (optional)
    Margin or the quiet zone around the QRCode. Default value is 10.
  • Width (optional)
    Width of the QRCode to be generated. Default value is 200.
    By default, automatic mode selection is used. Manual or mixed mode is not supported. The input string is automatically split in various segments optimized to produce the shortest possible bit stream.

Supported Operations

Not Applicable

Throws

QRCode node throws the following exception.

  • QRCode generation Failed

Returns

QRCode generated will be a base64 encoded png and will be available as part of the payload. None of the variables will be overwritten or enriched by this node.

# Develop a Service

Video tutorial

# Instructions

  1. Drag a drop an EventListener node from the palette to the canvas. Open the settings, configure the following and Save.

    Display Name : GET /qrcode
    Event Source : Amazon API gateway
    Verb : GET
    URL : /qrcode
    
  2. From the automation category add QRCode node to the canvas. Open the settings, configure the following and Save.

    QR String : https://www.kumologica.com
    Margin : 10
    Width : 200
    
  3. Wire the EventListener node to the QRCode node.

  4. Add the template node to the canvas. Open the settings, configure the following and Save.

    Target : $msg.payload
    Type : Mustache template
    

    Template :

    <html>
     <body>
         <img src="{{payload}}"/>
     </body>
    </html>
    
  5. Add EventListener End node from the palette to the canvas. Open the settings, configure the following and Save.

    Content-Type : text/html
    Payload : msg.payload
    
  6. Wire the QRCode node to template node and template node to EventListener End node.

# Try it

Sample Flow for QRCode generation