didPass
didPass Developer's Guide
didPass Developer's Guide
  • getting started
    • 👋Welcome to didPass
    • 📘Introduction
    • 🔺Triangle of Trust
    • ⚡Quickstart
      • Issuer - Typescript/Node.js
      • Verifier - Typescript/Node.js
      • Installing The SDK
  • Issuer
    • 📋Requirements
    • 🔧Installation
    • 💻Sample Code
      • Connecting Wallet with Issuer
        • Request Connect QR Code
        • Authenticate with Signature
      • Download Verifiable Credential
        • Generating QR Code for Claiming VC
        • Claiming and Signing Credential
      • Download Jws Credential
        • Generating QR Code for Claiming JWS Credential
        • Claiming JWS Credential
    • API References
  • Verifier
    • 📃Requirements
    • 🛠️Installation
    • 👨‍💻Sample Code
      • Prerequisite
      • Generating QR Code for DVR
      • Generating Signed DVR Token
      • Verifying Siwe
      • Verifying Proof
    • API References
  • Wallet
    • ✅Requirements
    • 📥Installation
    • 🖥️Sample Code
    • API References
  • References
    • didPass User's Guide
    • zkPass User's Guide
    • zkPass Developer's Guide
Powered by GitBook
On this page
  • Step 1: Import Required Modules
  • Step 2: Set Up Connection Details
  • Step 3: Generate QR Code
  • Step 4: Return QR Code
  • Final Code
  1. Issuer
  2. Sample Code
  3. Connecting Wallet with Issuer

Request Connect QR Code

Step 1: Import Required Modules

Import the necessary modules at the beginning of your script:

import { DIDAccount, QRGenerator } from "@didpass/issuer-sdk";

Step 2: Set Up Connection Details

Replace the placeholder values with your actual connection details:

const privateKey = "YOUR_PRIVATE_KEY";
const callbackUrl = "YOUR_CALLBACK_URL";
const sessionId = "YOUR_SESSION_ID";

const issuerDetail = {
  fullName: "Your Issuer Name",
  shortName: "IssuerShortName",
  logo: `url/images/logo.png`,
  restoreUrl: `url/to/restore`,
}; // your issuer detail (optional)

Step 3: Generate QR Code

Generate the QR code for connection:

const account = new DIDAccount(privateKey);
const qrGenerator = new QRGenerator(account);
const qrCode = await qrGenerator.connectQR(
  callbackUrl,
  sessionId,
  issuerDetail
);

Step 4: Return QR Code

Return the generated QR code:

return qrCode;

Final Code

Here's the complete code:

import { DIDAccount, QRGenerator } from "@didpass/issuer-sdk";

async function connectWithQR() {
  // Set up connection details
  const privateKey = "YOUR_PRIVATE_KEY";
  const callbackUrl = "YOUR_CALLBACK_URL";
  const sessionId = "YOUR_SESSION_ID";

  const issuerDetail = {
    fullName: "Your Issuer Name",
    shortName: "IssuerShortName",
    logo: "url/images/logo.png",
    restoreUrl: "url/to/restore",
  };

  // Generate QR code
  const account = new DIDAccount(privateKey);
  const qrGenerator = new QRGenerator(account);
  const qrCode = await qrGenerator.connectQR(
    callbackUrl,
    sessionId,
    issuerDetail
  );

  // Return QR code
  return qrCode;
PreviousConnecting Wallet with IssuerNextAuthenticate with Signature

Last updated 1 year ago

💻