Skip to content

Start typing to search the documentation.

QRCode SDK - API Reference (Legacy)

On this page

Exports

  • SelfQRCodeWrapper
  • SelfQRCode
  • SelfAppBuilder
  • SelfApp
  • getUniversalLink

SelfQRCodeWrapper / SelfQRCode

InputTypeDefaultDescription
selfApp#selfapp-The configured Self app instance.
onSuccess() ⇒ void;-Callback triggered when verification succeeds.
onErrordata: { error_code?: string; reason?: string }) => void-Callback triggered when verification fails.
type’websocket’ | ‘deeplink’websocketDetermines whether to use WebSocket or deep link QR.
websocketUrlstringWS_DB_RELAYERCustom WebSocket relayer URL.
sizenumber300Width and height of the QR Code in pixels.
darkModebooleanfalseToggles light/dark mode for QR code styling.
showBorderbooleantrueShow a colored border around the QR code that reflects the current status.
showStatusTextbooleantrueShow the status banner below the QR code.

SelfApp

PropertyTypeRequiredDescription
appNamestring✓The name of your app
logoBase64string✓Image URL or base64 encoded image
endpointTypehttps | staging_https | celo | staging_celo✓Required by the Self Protocol to know where the proofs will be verified: Onchain/Offchain and Real Documents/Mock Documents.
endpointstring✓Either the EVM Address or the backend URL where the proof must be verified.
deeplinkCallbackstring✕Triggered by the app after proof the proof is verified (or if it fails being generated)
scopestring✓A unique identifier for you application
userIdstring✓An identifier for the end user.
userIdType’uuid’ | ‘hex’✓Type of the user identifier
disclosures#selfappdisclosureconfig✓Object containing all disclosures and checks.
version1 | 2✕Whether to use Self V1 or SelfV2. Defaults to 2
userDefinedDatastring✕Any data you want to pass to your endpoint.

SelfAppDisclosureConfig

PropertyTypeDefaultDescription
issuing_statebooleanfalseRequest the issuing state from the document
namebooleanfalseRequest the full name from the document
passport_numberbooleanfalseRequest the document number.
nationalitybooleanfalseRequest the user’s nationality.
date_of_birthbooleanfalseRequest the date of birth.
genderbooleanfalseRequest the gender field.
expiry_datebooleanfalseRequest the document expiry date.
ofac**booleanfalseCheck against OFAC sanction lists.
excludedCountries**Country3LetterCode[][]Exclude users from specific ISO 3166-1 alpha-3 countries.
minimumAge**number0Require a minimum age (e.g., 18 (upto 99)).|
Was this page helpful?