OpenPassport docs
  • Overview
  • 🔌Use OpenPassport
    • Quickstart
    • Privacy flow
    • Playground
    • Setup WSS
  • ⚗️Technical docs
    • SDK class
      • OpenPassportVerifier
      • OpenPassport Attestation
    • Mobile app
    • Circuits
    • Registry
Powered by GitBook
On this page
  1. Technical docs
  2. SDK class

OpenPassportVerifier

The OpenPassportVerifier class is designed to facilitate the verification of user credentials and disclosures in applications using the OpenPassport system. It supports various modes of operation, allowing for both on-chain and off-chain proof verification. The class provides methods to configure verification parameters such as minimum age, nationality, and OFAC checks, and to generate intents for user interactions.

Parameters

Parameter
Type
Description

mode

Mode

The mode of operation, determining the type of proof verification.

scope

string

An identifier for the application, used to distinguish different apps.

Functions

Function
Parameters
Description
Output

setMinimumAge

age: number

Sets the minimum age requirement for verification. Throws an error if age is less than 10 or more than 100.

this

setNationality

country: (typeof countryNames)[number]

Sets the nationality requirement for verification.

this

discloseNationality

None

Sets nationality to 'Any', allowing disclosure of any nationality.

this

excludeCountries

...countries: (typeof countryNames)[number][]

Excludes specified countries from verification.

this

enableOFACCheck

None

Enables OFAC (Office of Foreign Assets Control) check for verification.

this

setModalServerUrl

modalServerUrl: string

Sets the URL for the modal server used in verification.

this

setCommitmentMerkleTreeUrl

commitmentMerkleTreeUrl: string

Sets the URL for the commitment Merkle tree, required for 'register' mode.

this

setRpcUrl

rpcUrl: string

Sets the RPC URL for on-chain operations.

this

allowMockPassports

None

Enables the use of mock passports for testing purposes.

this

getIntent

appName: string, userId: string, userIdType: UserIdType, sessionId: string, websocketUrl: string = WEBSOCKET_URL

Generates an intent string for user interaction, encoding the necessary verification parameters. Used by OpenPassportQRcode.

string

verifyProof

proof: OpenPassportAttestation

Verifies a proof against the configured verification parameters.

Promise<OpenPassportVerifierReport>

PreviousSDK classNextOpenPassport Attestation

Last updated 6 months ago

⚗️