🛠️
Technical Documentation
  • Introduction
    • About Empeiria
  • Empe Blockchain
    • Overview
    • Chain Architecture
      • Auth
      • Authz
      • Bank
      • Distribution
      • Governance
      • Staking
      • IBC
      • DidDoc
      • Vesting
      • Minter
  • EVDI
    • EVDI Architecture
    • Self-Sovereign Identity
      • Technical Foundations
      • Roles in the SSI framework
      • Protocols and Standards
  • User Guide
    • Empe DID Wallet
      • Intro
      • Download and first launch
      • Create or import did
      • Main screen overview
      • How to claim credential from issuer
      • How to use credential with verifier
      • Settings and other options
    • Keplr Wallet and Blockchain Operations
      • How to Connect Keplr Wallet
    • Ping Pub operation
    • Staking Tokens Guide
    • Voting on Governance Proposals Guide
    • Sending Tokens Guide
  • Developer Guide
    • Tutorial: Credential Issuance & Verification
      • Overview
      • Understanding Key Concepts
      • Project Setup
      • Deploying the Issuer
      • Uploading the Credential Schema
      • Issuing Credentials
      • Frontend for Credential Issuance
      • Testing Credential Issuance
      • Deploying the Verifier
      • Setting Up the Verification Flow
      • Creating a Verification Endpoint
      • Creating a Protected Dashboard
      • Testing the Verification Flow
      • Summary & Next Steps
    • One-click deployment
      • Introduction
      • Registration
      • Login
      • Creating an Issuer
      • Issuer Data Description
      • Creating a Verifier
      • Verifier Data Description
    • Verifier
      • Terminology and Concepts
      • Architecture Overview
      • Core Responsibilities
      • Query Language
      • Frontend Integration
      • Client Configuration
      • Security Considerations
      • Error Handling and Troubleshooting
      • Future Enhancements
      • References and Standards
      • FAQ
    • Issuer
      • Terminology and Concepts
      • Architecture Overview
      • Core Responsibilities
      • DID Document Management
      • Schemas Management
      • Issuing Credentials
      • Interacting with Wallets
      • Security Considerations
      • Error Handling and Troubleshooting
      • Future Enhancements
      • References and Standards
      • FAQ
    • Wallet SDK (Coming soon)
    • Introduction to cosmwasm
  • Validator Guide
    • Important links
    • Validators Guide
      • New validator
      • Hardware requirements
      • Required software installation
      • Go installation
      • Install prebuild binary
      • Install binary from source code (option B)
      • Configure a node
      • Cosmovisor setup
      • Sync with state-sync
      • Full state sync from archive snapshot
      • Latest snapshot
      • Run a Validator
      • Migration to v0.2.2
      • Migration to v0.3.0
    • FAQ
  • Appendix
    • Glossary
Powered by GitBook
On this page
  • Typical Workflow
  • Example Code Snippets
  1. Developer Guide
  2. Verifier

Frontend Integration

Integrating the Verifier into your front-end application provides a seamless user experience for credential verification:

Typical Workflow

  1. Initiate Verification: Trigger a flow from the front-end (e.g., "Login with Credential"). The backend requests an authorization QR code from the Verifier Service.

  2. Display QR Code: The front-end receives qr_code_url and renders it for the user. Users scan the QR code with their Empe DID Wallet.

  3. Open SSE Connection: Once the QR code is displayed, open an SSE connection to the Verifier Service. This channel delivers real-time updates (verified, failed, etc.).

  4. Wallet Interaction: The wallet retrieves verification requests, submits a VP, and upon successful validation, the SSE stream updates the front-end about success or failure.

  5. Finalize User Session: On a successful verification, redirect the user, show their dashboard, or grant access tokens as needed.

Example Code Snippets

Fetching QR Code:

const response = await fetch('/api/verifier/passwordless-login/v1/authorize-qr-code', {
  method: 'POST', headers: { 'Content-Type': 'application/json' }
});
const data = await response.json();
document.getElementById('qr-code').src = data.qr_code_url;

SSE Connection:

const eventSource = new EventSource(`/api/verifier/passwordless-login/v1/connection/${state}`);
eventSource.onmessage = (event) => {
  const result = JSON.parse(event.data);
  if (result.verification_status === 'verified') {
    window.location.href = result.redirect_url;
    eventSource.close();
  } else if (result.verification_status === 'failed') {
    alert('Verification failed. Please try again.');
    eventSource.close();
  }
};

By following these steps, you provide users with a smooth, secure verification experience integrated directly into your front-end.

PreviousQuery LanguageNextClient Configuration

Last updated 4 months ago