QRCode SDK - API Reference (Legacy)
# QRCode SDK - API Reference (Legacy)
:::note
**On Self Enterprise?** You don't use this SDK or render your own QR, see the [Enterprise quickstart](/docs/self-enterprise/get-started/quickstart/).
:::
## Exports
- SelfQRCodeWrapper
- SelfQRCode
- SelfAppBuilder
- SelfApp
- getUniversalLink
## SelfQRCodeWrapper / SelfQRCode
| Input | Type | Default | Description |
| -------------- | ---------------------------------------------------------------------- | :------: | -------------------------------------------------------------------------- |
| selfApp | [#selfapp](/docs/self-pass/frontend/qrcode-sdk-api-reference/#selfapp) | - | The configured Self app instance. |
| onSuccess | () ⇒ void; | - | Callback triggered when verification succeeds. |
| onError | data: { error_code?: string; reason?: string }) => void | - | Callback triggered when verification fails. |
| type | 'websocket' \| 'deeplink' | websocket | Determines whether to use WebSocket or deep link QR. |
| websocketUrl | string | WS_DB_RELAYER | Custom WebSocket relayer URL. |
| size | number | 300 | Width and height of the QR Code in pixels. |
| darkMode | boolean | false | Toggles light/dark mode for QR code styling. |
| showBorder | boolean | true | Show a colored border around the QR code that reflects the current status. |
| showStatusText | boolean | true | Show the status banner below the QR code. |
## SelfApp
| Property | Type | Required | Description |
| ---------------- | ------------------------------------------------------------------------------------------------------ | :------: | ---------------------------------------------------------------------------------------------------------------------------- |
| appName | string | <span class="mark-yes">✓</span> | The name of your app |
| logoBase64 | string | <span class="mark-yes">✓</span> | Image URL or base64 encoded image |
| endpointType | `https` \| `staging_https` \| `celo` \| `staging_celo` | <span class="mark-yes">✓</span> | Required by the Self Protocol to know where the proofs will be verified: Onchain/Offchain and Real Documents/Mock Documents. |
| endpoint | string | <span class="mark-yes">✓</span> | Either the EVM Address or the backend URL where the proof must be verified. |
| deeplinkCallback | string | <span class="mark-no">✕</span> | Triggered by the app after proof the proof is verified (or if it fails being generated) |
| scope | string | <span class="mark-yes">✓</span> | A unique identifier for you application |
| userId | string | <span class="mark-yes">✓</span> | An identifier for the end user. |
| userIdType | 'uuid' \| 'hex' | <span class="mark-yes">✓</span> | Type of the user identifier |
| disclosures | [#selfappdisclosureconfig](/docs/self-pass/frontend/qrcode-sdk-api-reference/#selfappdisclosureconfig) | <span class="mark-yes">✓</span> | Object containing all disclosures and checks. |
| version | 1 \| 2 | <span class="mark-no">✕</span> | Whether to use Self V1 or SelfV2. Defaults to 2 |
| userDefinedData | string | <span class="mark-no">✕</span> | Any data you want to pass to your endpoint. |
## SelfAppDisclosureConfig
| Property | Type | Default | Description |
| --------------------- | --------------------- | :------: | --------------------------------------------------------- |
| issuing_state | boolean | false | Request the issuing state from the document |
| name | boolean | false | Request the full name from the document |
| passport_number | boolean | false | Request the document number. |
| nationality | boolean | false | Request the user’s nationality. |
| date_of_birth | boolean | false | Request the date of birth. |
| gender | boolean | false | Request the gender field. |
| expiry_date | boolean | false | Request the document expiry date. |
| ofac\*\* | boolean | false | Check against OFAC sanction lists. |
| excludedCountries\*\* | Country3LetterCode\[] | \[] | Exclude users from specific ISO 3166-1 alpha-3 countries. |
| minimumAge\*\* | number | 0 | Require a minimum age (e.g., `18` (upto `99`)).\| |
Read https://docs.self.xyz/docs/self-pass/frontend/qrcode-sdk-api-reference.md so I can ask questions about this Self documentation page.
Exports
- SelfQRCodeWrapper
- SelfQRCode
- SelfAppBuilder
- SelfApp
- getUniversalLink
SelfQRCodeWrapper / SelfQRCode
| Input | Type | Default | Description |
|---|---|---|---|
| selfApp | #selfapp | - | The configured Self app instance. |
| onSuccess | () ⇒ void; | - | Callback triggered when verification succeeds. |
| onError | data: { error_code?: string; reason?: string }) => void | - | Callback triggered when verification fails. |
| type | ’websocket’ | ‘deeplink’ | websocket | Determines whether to use WebSocket or deep link QR. |
| websocketUrl | string | WS_DB_RELAYER | Custom WebSocket relayer URL. |
| size | number | 300 | Width and height of the QR Code in pixels. |
| darkMode | boolean | false | Toggles light/dark mode for QR code styling. |
| showBorder | boolean | true | Show a colored border around the QR code that reflects the current status. |
| showStatusText | boolean | true | Show the status banner below the QR code. |
SelfApp
| Property | Type | Required | Description |
|---|---|---|---|
| appName | string | ✓ | The name of your app |
| logoBase64 | string | ✓ | Image URL or base64 encoded image |
| endpointType | https | 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. |
| endpoint | string | ✓ | Either the EVM Address or the backend URL where the proof must be verified. |
| deeplinkCallback | string | ✕ | Triggered by the app after proof the proof is verified (or if it fails being generated) |
| scope | string | ✓ | A unique identifier for you application |
| userId | string | ✓ | An identifier for the end user. |
| userIdType | ’uuid’ | ‘hex’ | ✓ | Type of the user identifier |
| disclosures | #selfappdisclosureconfig | ✓ | Object containing all disclosures and checks. |
| version | 1 | 2 | ✕ | Whether to use Self V1 or SelfV2. Defaults to 2 |
| userDefinedData | string | ✕ | Any data you want to pass to your endpoint. |
SelfAppDisclosureConfig
| Property | Type | Default | Description |
|---|---|---|---|
| issuing_state | boolean | false | Request the issuing state from the document |
| name | boolean | false | Request the full name from the document |
| passport_number | boolean | false | Request the document number. |
| nationality | boolean | false | Request the user’s nationality. |
| date_of_birth | boolean | false | Request the date of birth. |
| gender | boolean | false | Request the gender field. |
| expiry_date | boolean | false | Request the document expiry date. |
| ofac** | boolean | false | Check against OFAC sanction lists. |
| excludedCountries** | Country3LetterCode[] | [] | Exclude users from specific ISO 3166-1 alpha-3 countries. |
| minimumAge** | number | 0 | Require a minimum age (e.g., 18 (upto 99)).| |
Was this page helpful?
Thanks — what went wrong?
Thanks for your feedback!