Skip to content

Start typing to search the documentation.

QRCode SDK - API Reference

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.

SelfApp

PropertyTypeRequiredDescription
appNamestringThe name of your app
logoBase64stringImage URL or base64 encoded image
endpointTypehttps | staging_https | celo | staging_celoRequired by the Self Protocol to know where the proofs will be verified: Onchain/Offchain and Real Documents/Mock Documents.
endpointstringEither the EVM Address or the backend URL where the proof must be verified.
deeplinkCallbackstringTriggered by the app after proof the proof is verified (or if it fails being generated)
scopestringA unique identifier for you application
userIdstringAn identifier for the end user.
userIdType’uuid’ | ‘hex’Type of the user identifier
disclosures#selfappdisclosureconfigObject containing all disclosures and checks.
version1 | 2Whether to use Self V1 or SelfV2. Defaults to 2
userDefinedDatastringAny 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)).|