Web verification quickstart guide
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 tutorial and reference documentation for each platform.
Using the Verifier Web SDK to verify an mDoc presented remotely to a web application:
Configure the MATTR VII verifier tenant
Configure a Verifier application on MATTR VII
- Log into the MATTR Portal.
- Expand the Credential Verification section in the left-hand navigation panel.
- Select Applications.
- Select the Create new button.
- Use the Name text box to insert a meaningful and friendly name for your application.
- Use the Type radio button to select Web.
- Use the Allowed domains text box to insert a placeholder domain name (e.g.
place-holder.com). This indicates domain names that the MATTR VII tenant can verify incoming requests are from known and trusted applications. You will update this placeholder value later. - Use the Redirect URIs text box to insert a placeholder redirect URI (e.g.
https://place-holder.com). This is the URI the user would be redirected to after presenting a credential on a same-device flow. You will update this placeholder value later. - Select the Create button to create the new application and display the Application detail screen.
- Copy and record the
IDvalue. You will use it later when initializing the SDK.
Configure a trusted issuer
- Expand the Credential Verification section in the left-hand navigation panel.
- Select Trusted issuers.
- Select the Create new button.
- Use the Certificate PEM file to upload the public key certificate of the issuer you want to trust.
- Select the Add button to add the new trusted issuer.
Embed the Verifier Web SDK in your web application
Install the SDK
- Install the SDK using your package manager of choice. For example, using Yarn:
yarn add @mattrglobal/verifier-sdk-web- Import the SDK into your application code:
import { MATTRVerifierSDK } from "@mattrglobal/mattr-verifier-sdk-web";- Include the Verifier Web SDK in your HTML via a script tag:
<script src="https://cdn.mattr.global/js/verifier-sdk-web/{VERSION}/verifier-js.production.js"></script>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:
const 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, andportraitfrom theorg.iso.18013.5.1namespace.
Define credential request options
Using your credential query, define the credential request options:
const 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:
const 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.
How would you rate this page?