@mattrglobal/verifier-sdk-web 1.1.1-unstable.179 → 1.1.1-unstable.196

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.
@@ -5,7 +5,7 @@ export declare enum InitializeErrorMessage {
5
5
  /**
6
6
  * Initializes the SDK with the provided options.
7
7
  *
8
- * @param options - The options to initialize the SDK with.
8
+ * @param options - The {@link InitializeOptions | options} to initialize the SDK with.
9
9
  */
10
10
  export declare const initialize: (options: InitializeOptions) => void;
11
11
  export declare const getInitializeOptions: () => InitializeOptions | undefined;
@@ -3,7 +3,7 @@ import { RequestCredentialsError, RequestCredentialsOptions, RequestCredentialsR
3
3
  /**
4
4
  * Requests credentials based on the provided options.
5
5
  *
6
- * @param options - The options to request credentials with.
7
- * @returns A promise that resolves to a result containing either the requested credentials or an error.
6
+ * @param options - The options to request credentials with {@link RequestCredentialsOptions}.
7
+ * @returns A promise that resolves to a result containing either the {@link RequestCredentialsResponse | requested credentials} or an {@link RequestCredentialsError | error}.
8
8
  */
9
9
  export declare const requestCredentials: (options: RequestCredentialsOptions) => Promise<Result<RequestCredentialsResponse, RequestCredentialsError>>;
@@ -1,15 +1,16 @@
1
1
  import { Result } from "neverthrow";
2
2
  import { BaseError } from "../common";
3
3
  import { RequestCredentialsErrorType, RequestCredentialsResponse, RequestCredentialsWithDcApiOptions } from "./types";
4
- export declare const requestCredentialsWithDigitalCredentialsApi: (options: RequestCredentialsWithDcApiOptions) => Promise<Result<RequestCredentialsResponse, BaseError<RequestCredentialsErrorType.RequestCredentialsFailed>>>;
5
4
  /**
6
- * TypeScript does not know that window.DigitalCredential is a valid property,
7
- * even though it might exist at runtime, because the feature is experimental
5
+ * Request credentials for the Digital Credentials API
8
6
  *
9
- * @returns boolean.
7
+ * @param options - {@link RequestCredentialsWithDcApiOptions}
8
+ * @ignore - Dark release
10
9
  */
10
+ export declare const requestCredentialsWithDigitalCredentialsApi: (options: RequestCredentialsWithDcApiOptions) => Promise<Result<RequestCredentialsResponse, BaseError<RequestCredentialsErrorType.RequestCredentialsFailed>>>;
11
11
  /**
12
12
  * Checks if Digital Credentials API feature is supported for the current browser.
13
+ * @ignore - Dark release
13
14
  *
14
15
  * @returns boolean.
15
16
  */
@@ -28,26 +28,13 @@ export type CrossDeviceRequestCredentialsOptions = {
28
28
  sessionId: string;
29
29
  };
30
30
  /**
31
- * Options for requestCredentials function without openId4vp configuration.
32
- * Can be used for requesting credential with Digital Credentials API or with openId4vp cross-device flow
33
- */
34
- export type RequestCredentialsBaseOptions = {
35
- /**
36
- * An array of CredentialQuery objects that specify the credentials to be requested.
37
- */
38
- credentialQuery: CredentialQuery[];
39
- /**
40
- * The URI to which the user will be redirected after the credential request is completed.
41
- */
42
- challenge?: string;
43
- };
44
- /**
45
- * Options for openid4vpConfiguration to request credentials with same device
31
+ * Options for openid4vpConfiguration to request credentials via a same-device flow.
46
32
  */
47
33
  export type OpenId4vpConfigurationSameDeviceOptions = {
48
34
  /**
49
- * An optional identifier for wallet configuration. If not provided, the default wallet will be used.
50
- * This parameter is defined as part of your MATTR VII tenant verifier configuration
35
+ * An optional identifier for MATTR VII wallet provider configuration.
36
+ *
37
+ * If not provided, defaults to the global wallet schema 'mdoc-openid4vp://'.
51
38
  */
52
39
  walletProviderId?: string;
53
40
  /**
@@ -66,7 +53,7 @@ export declare const OpenId4vpConfigSameDeviceOptionsValidator: v.ObjectSchema<{
66
53
  readonly redirectUri: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, "Must not be empty">, v.UrlAction<string, undefined>]>;
67
54
  }, undefined>;
68
55
  /**
69
- * Options for openid4vpConfiguration to request credentials with cross device
56
+ * Options for openid4vpConfiguration to request credentials via a cross-device flow.
70
57
  */
71
58
  export type OpenId4vpConfigurationCrossDeviceOptions = {
72
59
  /**
@@ -97,23 +84,43 @@ export type OpenId4vpConfigurationAutoDetectOptions = {
97
84
  */
98
85
  redirectUri: string;
99
86
  /**
100
- * An optional mode in which the credentials are requested. If not provided, the mode is determined based on the device (isMobileDetect(navigator.userAgent)).
87
+ * An optional mode in which the credentials are requested.
88
+ *
89
+ * If not provided, the mode will be automatically detected based off the end users device.
90
+ *
91
+ * @example isMobileDetect(navigator.userAgent)
92
+
101
93
  */
102
94
  mode?: Mode;
103
95
  };
96
+ /**
97
+ * Configuration for OpenID4VP presentation flow both same-device and cross-device flows.
98
+ */
99
+ export type OpenIdvpConfiguration = OpenId4vpConfigurationSameDeviceOptions | OpenId4vpConfigurationCrossDeviceOptions | OpenId4vpConfigurationAutoDetectOptions;
104
100
  export declare const OpenId4vpConfigAutoDetectOptionsValidator: v.ObjectSchema<{
105
101
  readonly walletProviderId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
106
102
  readonly redirectUri: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, "Must not be empty">, v.UrlAction<string, undefined>]>;
107
103
  readonly mode: v.OptionalSchema<v.PicklistSchema<[Mode.CrossDevice, Mode.SameDevice], undefined>, undefined>;
108
104
  }, undefined>;
109
105
  /**
110
- * Options for the requestCredentials function
106
+ * Options for the requestCredentials function.
111
107
  */
112
- export type RequestCredentialsOptions = RequestCredentialsBaseOptions & {
108
+ export type RequestCredentialsOptions = {
109
+ /**
110
+ * An array of {@link CredentialQuery} objects that specify the credentials to be requested.
111
+ */
112
+ credentialQuery: CredentialQuery[];
113
+ /**
114
+ * An optional unique challenge allowing association and verification of a specific session.
115
+ *
116
+ * If not provided a generated challenge will be created.
117
+ * @example MATTRVerifierSDK.utils.generateChallenge()
118
+ */
119
+ challenge?: string;
113
120
  /**
114
121
  * Optional configuration for openid4vp presentation flow
115
122
  */
116
- openid4vpConfiguration?: OpenId4vpConfigurationSameDeviceOptions | OpenId4vpConfigurationCrossDeviceOptions | OpenId4vpConfigurationAutoDetectOptions;
123
+ openid4vpConfiguration?: OpenIdvpConfiguration;
117
124
  };
118
125
  export declare const RequestCredentialsOptionsValidator: v.ObjectSchema<{
119
126
  readonly credentialQuery: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
@@ -160,11 +167,12 @@ export type MessageEvent = {
160
167
  */
161
168
  export type RequestCredentialsResponse = {
162
169
  /**
163
- * Contains the result of the presentation session if result is configured to be available in the front channel
170
+ * Contains the result of the presentation session if the associated MATTR VII verifier application is configured
171
+ * to return results to the front channel (`frontChannelResultAvailable` set to `true`).
164
172
  */
165
173
  result?: PresentationSessionResult;
166
174
  /**
167
- * when frontChannelResultAvailable is set to true
175
+ * Session identifier which can be used to fetch a presentation result via a back channel.
168
176
  */
169
177
  sessionId: string;
170
178
  /**
@@ -216,13 +224,18 @@ export type HandleRedirectCallbackResponse = {
216
224
  * Contains the result of the presentation session if result is configured to be available in the front channel
217
225
  */
218
226
  result?: PresentationSessionResult;
227
+ /**
228
+ * Session identifier which can be used to fetch a presentation result via a back channel.
229
+ */
219
230
  sessionId: string;
220
231
  };
221
232
  /**
222
233
  * Options for the initialize function
223
234
  */
224
235
  export type InitializeOptions = {
236
+ /** MATTR VII Tenant or base URL */
225
237
  apiBaseUrl: string;
238
+ /** MATTR VII configured Verifier application identifier */
226
239
  applicationId: string;
227
240
  };
228
241
  export declare const InitializeOptionsValidator: v.ObjectSchema<{
@@ -7,7 +7,7 @@
7
7
  * Do Not Translate or Localize
8
8
  *
9
9
  * Bundle of @mattrglobal/verifier-sdk-web
10
- * Generated: 2025-05-26
10
+ * Generated: 2025-05-27
11
11
  * Version: 1.1.0
12
12
  * Dependencies:
13
13
  *