DIDComm.sendDIDCommMessage() method

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Sends the given message to the recipient. If a return transport is provided it will be checked whether the parent thread allows reusing the route. You cannot reuse the transport if the message was forwarded from a DIDComm mediator.

Emits an eventType 'DIDCommV2Message-sent' that contains the message id of packed DIDComm message IPackedDIDCommMessage after the message was sent.

sendDIDCommMessage(args: ISendDIDCommMessageArgs, context: IAgentContext<IResolver>): Promise<string>;


argsISendDIDCommMessageArgsAn object containing the message, recipient information and optional information about the transport that should be used.
contextIAgentContext <IResolver>This method requires an agent that also has IResolver plugins in use. When calling this method, the context is supplied automatically by the framework.


The transport id that was used to send the message. It throws an error in case something went wrong.