kin-node
kin-node copied to clipboard
Webhooks assume you use express
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.
This is an issue for us as well.
Was this resolved?
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.