Skip to main content

Handle invitation

Handles the interaction once the wallet connects, usually by scanning the QR code of an offered credential or request for proof, to a share endpoint URL.

Function

handleInvitation(
url: string,
organisationId: string,
transport: string[] | undefined
): Promise<InvitationResult>

Parameters

  • url - Usually encoded as a QR code or deep link by the issuer or verifier.

  • organisationId - From the create organisation function.

  • transport - For systems with multiple transport protocols configured, specify the transport protocol(s) to be used for the exchange. See the transport array guide for handleInvitation.

Return value

export type InvitationResult =
| InvitationResultCredentialIssuance
| InvitationResultProofRequest;

Related structures:

export interface InvitationResultCredentialIssuance {
interactionId: string;
credentialIds: Array<CredentialListItem["id"]>;
txCode?: OpenID4VCITxCode;
}
export interface InvitationResultProofRequest {
interactionId: string;
proofId: ProofDetail["id"];
}

Handle invitation returns one of:

  • CredentialIssuance: holder is connecting to a credential offer from an issuer

  • ProofRequest: holder is connecting to a proof request from a verifier

Fields

  • interactionId - The ID identifying the particular issuance or verification. This value is used when responding to an offered credential or a request for proof.

  • credentialIds - Array of IDs of credentials being offered.

  • txCode - Transaction code object. If a pre-authorized code is issued with a transaction code object, the wallet user must input a transaction code to receive the offered credential. This code is typically sent through a separate channel such as SMS or email.

    The object may contain information about the expected code; this information can be passed on to the frontend to assist the user in inputting the code.

  • proofId - ID of proof request.