Type alias RequestCredentialsOptions

RequestCredentialsOptions: {
    challenge?: string;
    credentialQuery: CredentialQuery[];
    onPresentationRequest?: ((request) => void | Promise<void>);
    openid4vpConfiguration?: OpenIdvpConfiguration;
    state?: string;
}

Options for the requestCredentials function.

Type declaration

  • Optional challenge?: string

    An optional unique challenge allowing association and verification of a specific session.

    If not provided a generated challenge will be created.

    Example

    MATTRVerifierSDK.utils.generateChallenge()
    
  • credentialQuery: CredentialQuery[]

    An array of CredentialQuery objects that specify the credentials to be requested.

  • Optional onPresentationRequest?: ((request) => void | Promise<void>)
      • (request): void | Promise<void>
      • An optional hook invoked once after presentation session creation, and again every time the OpenID4VP auth-request URI is regenerated (cross-device QR code refreshes). Not re-invoked beyond the initial call for same-device or Digital Credentials API sessions.

        If this hook throws or its returned promise rejects, the in-progress presentation is aborted (the session is aborted server-side and, for cross-device, the iframe is closed) and requestCredentials() resolves with an RequestCredentialsErrorType.OnPresentationRequestFailed error. To continue the presentation flow regardless of an error in the hook, catch and handle the error inside the hook.

        Parameters

        • request: PresentationRequest

        Returns void | Promise<void>

  • Optional openid4vpConfiguration?: OpenIdvpConfiguration

    Optional configuration for openid4vp presentation flow

  • Optional state?: string

    An optional customer-supplied correlation reference attached to the presentation session. When provided, replaces the internal sessionId as the OpenID4VP state claim and is appended as a plain query parameter to the auth request URI.

Generated using TypeDoc