Verifying a credential remotely with MATTR Pi Verifier Web SDK
This guide summarizes how to use the MATTR Pi Verifier Web SDK to verify an mDoc that is presented remotely to a web application. The process follows the remote presentation workflow as defined by OID4VP and ISO/IEC 18013-7:2025 .
Use this guide as a quick reference to begin. For more detailed instructions, see the linked tutorials and reference documentation for each platform.
Using the Verifier Web SDK to verify an mDoc presented remotely to a web application:
Core usage
Initialize the SDK
MATTRVerifierSDK.initialise({
apiBaseUrl: '<YOUR_TENANT_URL>',
applicationId: '<APPLICATION_ID>'
})
apiBaseUrl
: The base URL of the MATTR tenant used to handle mDocs verification.applicationId
: The ID of a verifier application in the referenced MATTR tenant.
Create a credential query
Define a credential query object with the following structure:
credentialQuery = {
profile: 'MATTRVerifierSDK.OpenidPresentationCredentialProfileSupported.MOBILE',
docType: 'org.iso.18013.5.1.mDL',
nameSpaces: {
'org.iso.18013.5.1': {
age_over_18: {},
given_name: {},
family_name: {},
portrait: {}
}
}
}
profile
: The profile to use for the credential query. For remote presentations of mDocs, useMATTRVerifierSDK.OpenidPresentationCredentialProfileSupported.MOBILE
.docType
: The type of the mDoc to query. For mDLs, useorg.iso.18013.5.1.mDL
.nameSpaces
: The namespaces and attributes to request from the mDoc. In this example, we requestage_over_18
,given_name
,family_name
, andportrait
from theorg.iso.18013.5.1
namespace.
Define credential request options
Using your credential query, define the credential request options:
options = {
credentialQuery: [credentialQuery],
challenge: generateChallenge(),
openid4vpConfiguration: {
redirectUri: '<YOUR_APP_REDIRECT_URI>',
walletProviderId: '<YOUR_WALLET_PROVIDER_ID>'
}
}
credentialQuery
: An array of credential queries to request from the mDoc. Define what information is requested from the user for verification.challenge
: A unique challenge string to prevent replay attacks. Use a secure random generator to create this.openid4vpConfiguration
: Configuration for the OID4VP flow:redirectUri
: The web application to redirect the user to after completing a same-device presentation flow.walletProviderId
: The ID of a trusted wallet provider configured in the MATTR tenant. The tenant will only accept mDocs presented by wallets from this provider.
Request credentials and handle the verification results
Use the options defined above to request credentials for verification:
results = await MATTRVerifierSDK.requestCredentials(options)
Once results are returned, you can parse and display them to the user as needed. Refer to the tutorial for an example.