@mattrglobal/verifier-sdk-web 2.1.1-unstable.6 → 2.1.1-unstable.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -18,6 +18,7 @@
18
18
  - [Determine supported presentation flows](#determine-supported-presentation-flows)
19
19
  - [Define wallet identifiers](#define-wallet-identifiers)
20
20
  - [Configure redirectUri](#configure-redirecturi)
21
+ - [Request credentials using the DC API](#request-credentials-using-the-dc-api)
21
22
  - [Request credentials examples](#request-credentials-examples)
22
23
  - [Request credentials with automatic flow selection](#request-credentials-with-automatic-flow-selection)
23
24
  - [Request credentials with explicit same-device flow](#request-credentials-with-explicit-same-device-flow)
@@ -42,6 +43,7 @@ The Verifier Web SDK is a powerful tool for integrating online credential verifi
42
43
  * Supports both same-device and cross-device presentation flows.
43
44
  * Secure handling of mDocs requests and responses.
44
45
  * Compliant with [ISO/IEC DTS 18013-7](https://www.iso.org/standard/82772.html).
46
+ * Offers [DC API](https://wicg.github.io/digital-credentials/) support as a **tech-preview**.
45
47
 
46
48
  > In this SDK mDocs are referred to as Mobile Credentials.
47
49
 
@@ -192,6 +194,45 @@ You can define an identifier of a specific wallet you want to invoke with this v
192
194
 
193
195
  When using the same-device presentation flow, the SDK must define what URI to redirect the user to once they complete the verification workflow in their wallet app. This can be any URI (including custom URI schemes), and must match one of the values defined in the [`redirectUris` array](https://learn.mattr.global/api-reference/latest/tag/Verifier-applications#operation/postVerifierApplication!path=0/openid4vpConfiguration/redirectUris&t=request) when creating a verifier application.
194
196
 
197
+ ## Request credentials using the DC API
198
+
199
+ > DC API support is currently offered as a **tech preview**. As such, functionality may be limited, may not work in all scenarios, and could change or break without prior notice.
200
+
201
+ 1. Add the `dcApiConfiguration` object to your MATTR VII [verifier application configuration](https://learn.mattr.global/docs/verification/remote-verification-api-reference/verifier-applications#update-a-verifier-application).
202
+
203
+ 2. Use the SDK's `isDigitalCredentialsApiSupported` method to determine if the user's browser supports the Digital Credentials API:
204
+
205
+ ```typescript
206
+ import * as MattrVerifierSDK from "@mattrglobal/verifier-sdk-web";
207
+
208
+ const isDcApiSupported = MattrVerifierSDK.isDigitalCredentialsApiSupported();
209
+ ```
210
+
211
+ This returns `true` if the browser supports DC API, `false` otherwise.
212
+
213
+ 3. When calling `requestCredentials`, conditionally set the `walletProviderId` based on DC API support:
214
+
215
+ ```typescript
216
+ const options: MattrVerifierSDK.RequestCredentialsOptions = {
217
+ credentialQuery: [credentialQuery],
218
+ challenge: MattrVerifierSDK.utils.generateChallenge(),
219
+ openid4vpConfiguration: {
220
+ redirectUri: window.location.origin,
221
+ walletProviderId: isDcApiSupported ? undefined : "your-wallet-provider-id",
222
+ },
223
+ };
224
+
225
+ const results = await MattrVerifierSDK.requestCredentials(options);
226
+ ```
227
+
228
+ The Verifier Web SDK uses the DC API **only when all** of the following conditions are met:
229
+
230
+ - The browser supports DC API (`isDigitalCredentialsApiSupported()` returns `true`).
231
+ - The credential request is for a **single credential** (DC API doesn't support multiple credentials in one request).
232
+ - No `walletProviderId` is provided in the request options.
233
+
234
+ If any condition is not met, the SDK falls back to the standard OID4VP flow.
235
+
195
236
  # Request credentials examples
196
237
 
197
238
  ## Request credentials with automatic flow selection
@@ -7,7 +7,7 @@
7
7
  * Do Not Translate or Localize
8
8
  *
9
9
  * Bundle of @mattrglobal/verifier-sdk-web
10
- * Generated: 2025-09-28
10
+ * Generated: 2025-11-23
11
11
  * Version: 2.1.0
12
12
  * Dependencies:
13
13
  */