openwallet-foundation / credo-ts

Typescript framework for building decentralized identity and verifiable credential solutions
https://credo.js.org
Apache License 2.0
260 stars 197 forks source link

Help needed to register webhook-url in AFJ based agents. #1633

Closed Sshovon closed 10 months ago

Sshovon commented 10 months ago

In ACA-Py (Aries Cloud Agent Python), it is possible to specify and configure webhook URLs when creating wallets. Is there a way to include webhook URLs when using an AFJ-based agent similar to how it's done in ACA-Py?

TimoGlastra commented 10 months ago

When using the AFJ Rest wrapper this is possible, however when using the Agent directly this is not part of the default features.

You can however very simply set this up yourself. Listen to the events you'd like to receive webhooks for, and whenever an event is emitted, you send the webhook to your desired URL. See for example the implementation in the rest wrapper: https://github.com/hyperledger/aries-framework-javascript-ext/blob/main/packages/rest/src/events/WebhookEvent.ts#L5-L17

It does miss some stability features such as retries. That's something you'd have to add still