You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
As for right now, there doesn't to be any type definition for webhook events inside this library that will help validate the incoming webhook events.
Describe the solution you'd like
It'd be great to have a built-in type definition for webhook events in this library. This will save us time of having to manually write our own.
Describe alternatives you've considered
What i've been doing so far is to model the types of each events(charge.success as for now) based on received webhook response or often time cross check supported-events
Interesting request @waptik. This isn't something we've considered adding to the library, however, do you mind sharing how you'd like this to work? Using the charge.success as an example, how would you want to parse an event in your webhook function if types are available?
Got it @orimdominic@waptik. I'll look into adding this in an upcoming version. You could also make this your first contribution if you are up for it 😀.
Activity
damilola-paystack commentedon Oct 31, 2022
Interesting request @waptik. This isn't something we've considered adding to the library, however, do you mind sharing how you'd like this to work? Using the
charge.successas an example, how would you want to parse an event in your webhook function if types are available?orimdominic commentedon Nov 1, 2022
@damilola-paystack I think @waptik means having types like what we have here in Stripe Events
waptik commentedon Nov 1, 2022
Yup, this is exactly what I meant.
I saw it being used in a project and I thought it'd be great to have the same thing here as part of the library.
damilola-paystack commentedon Nov 3, 2022
Got it @orimdominic @waptik. I'll look into adding this in an upcoming version. You could also make this your first contribution if you are up for it 😀.
gray-adeyi commentedon Dec 14, 2024
@gray-adeyi/paystack-sdk 0.2.4 release is now available with even better type support 🔥 https://www.npmjs.com/package/@gray-adeyi/paystack-sdk