kin-node icon indicating copy to clipboard operation
kin-node copied to clipboard

Webhooks assume you use express

Open doc-l opened this issue 4 years ago • 3 comments

If you don't use express, it's nearly impossible to use webhooks, because the webhook functionality assumes express responses: https://github.com/kinecosystem/kin-node/blob/91cb7115a8e198c293793a8de267d719a7eaa283/src/webhook/index.ts#L282

A better function signature would be to have a function that has as input the body and headers of some request, and as output what should be sent as a result.

doc-l avatar Nov 12 '20 09:11 doc-l

This is an issue for us as well.

radicaled avatar Nov 24 '20 20:11 radicaled

Was this resolved?

chaseeb avatar Jan 19 '21 18:01 chaseeb

No, if you don't use express it's extremely difficult to get the webhooks working. I got it working by reverse engineering the express code and writing/copy/pasting parts of it myself, omitting some crucial features to get it working.

Ideally the webhooks don't assume express or any framework, just return some promises that you can deal with yourself and provide an express example.

doc-l avatar Jan 20 '21 13:01 doc-l