Veros
Go to Veros
  • Welcome to Veros
  • Overview
    • Introduction
  • Developers
    • Introduction
    • Web Widget Integration
  • Legal
    • Terms of Use
  • Privacy Policy
  • Support
    • Contact Us
Powered by GitBook
On this page
  • Installation
  • Basic Usage
  • Widget Parameters
  • Query Parameters
  • External Nullifier
  • Pseudonym
Export as PDF
  1. Developers

Web Widget Integration

Integrate the Veros Web Widget into your application

The Veros Web Widget is a React component that handles the user-facing verification flow. It displays a QR code that users scan with the Veros mobile app to complete their palm verification.

Installation

npm install @veros/widget
# or
yarn add @veros/widget

Basic Usage

import { VerosWidget } from "@veros/widget";

function MyVerificationComponent() {
  const handleSuccess = (proof) => {
    // Send proof to your backend for verification
    console.log("Verification successful:", proof);
  };

  return (
    <VerosWidget
      context="Veros - Palm Verification Timestamp"
      typeId="3"
      query={JSON.stringify({
        conditions: [
          {
            identifier: "val",
            operation: "IN",
            value: {
              from: "1743436800",
              to: "2043436800",
            },
          },
        ],
        options: {
          expiredAtLowerBound: "1743436800",
          externalNullifier: "Your App - Verification Purpose",
          equalCheckId: "0",
          pseudonym: "0",
        },
      })}
      onSuccess={handleSuccess}
    >
      {({ open }) => <button onClick={open}>Verify with Veros</button>}
    </VerosWidget>
  );
}

Widget Parameters

Parameter
Type
Description

context

string

The verification context. Currently only "Veros - Palm Verification Timestamp" is supported

typeId

string

The type ID for verification. Use "3" for palm verification

query

string

JSON string containing verification parameters

onSuccess

function

Callback function that receives the verification proof

Query Parameters

The query parameter expects a JSON string with the following structure:

{
  "conditions": [
    {
      "identifier": "val",
      "operation": "IN",
      "value": {
        "from": "1743436800",
        "to": "2043436800"
      }
    }
  ],
  "options": {
    "expiredAtLowerBound": "1743436800",
    "externalNullifier": "Your App - Verification Purpose",
    "equalCheckId": "0",
    "pseudonym": "0"
  }
}

External Nullifier

The externalNullifier is a unique identifier that represents the specific action or purpose for which the verification is being performed. It ensures that proofs can't be reused across different actions.

For example, you might use:

  • "MyApp - Account Creation"

  • "MyApp - Login"

  • "MyApp - Reward Claim"

Pseudonym

The pseudonym field can be used to include additional user-specific information in the proof. This could be useful for tying the verification to a specific user in your system. For example, you could set this to a user's wallet address if you want to verify identity before sending tokens.

PreviousIntroductionNextTerms of Use

Last updated 1 month ago