Generating QR Code for DVR

This flow diagram illustrates the process of Generating QR Code for DVR

Step 1: Set Up Details

Replace the placeholder values with your actual details:

const callbackUrl = "YOUR_CALLBACK_URL";
const dvr = {
  dvr_id: "YOUR_DVR_ID",
  dvr_title: "YOUR_DVR_TITLE",
};
const from = "YOUR_VERIFIER_NAME";
const reason = "YOUR_REASON";
const message = "YOUR_MESSAGE";

const dvrRequest = {
  callbackUrl,
  dvr,
  from,
  reason,
  message,
};

Step 2: Generate QR Code

Generate the QR code for credential:

const qrCode = verifier.generateQrCode(dvrRequest);

Step 3: Return QR Code

Return the generated QR code:

return qrCode;

Final Code

Here's the complete code:

import { Verifier } from "@didpass/verifier-sdk";

function generateDvrQr() {
    const verifier = new Verifier();
    const callbackUrl = "YOUR_CALLBACK_URL";
    const dvr = {
        dvr_id: "YOUR_DVR_ID",
        dvr_title: "YOUR_DVR_TITLE",
    };
    const from = "YOUR_VERIFIER_NAME";
    const reason = "YOUR_REASON";
    const message = "YOUR_MESSAGE";

    const dvrRequest = {
        callbackUrl,
        dvr,
        from,
        reason,
        message,
    };

    const qrCode = verifier.generateQrCode(dvrRequest);
    
    return qrCode;
}

Last updated