Ko-fi webhook handler for Next.js.
For more information visit https://ko-fi.com/manage/webhooks
npm install @ko-fi/next
yarn add @ko-fi/next
View example implementation here;
import { kofi } from '@ko-fi/next';
export default kofi(app, {
onData: (data, req) => {
console.log('onData called');
},
onCommission: (data, req) => {
console.log('onCommission called');
},
onDonation: (data, req) => {
console.log('onDonation called');
},
onShopOrder: (data, req) => {
console.log('onShopOrder called');
},
onSubscription: (data, req) => {
console.log('onSubscription called');
},
onError: (err, req) => {
console.error('onError called');
},
verificationToken: 'token',
});