# @ko-fi/next

> Ko-fi webhook handler for Next.js

Latest version **1.0.2** (published 2022-10-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install @ko-fi/next
pnpm add @ko-fi/next
yarn add @ko-fi/next
bun add @ko-fi/next
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-10-18 |
| First published | 2022-10-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | onseso |
| Maintainers | oneso |
| Keywords | ko-fi, kofi, next |

## Links

- npm: https://www.npmjs.com/package/@ko-fi/next
- Repository: https://github.com/oneso/ko-fi-next
- Homepage: https://github.com/oneso/ko-fi-next#readme
- Issues: https://github.com/oneso/ko-fi-next/issues
- npm.io page: https://npm.io/package/@ko-fi/next

## Dependencies (2)

- [@ko-fi/types](https://npm.io/package/@ko-fi/types.md) ^1.0.3
- [@ko-fi/handler](https://npm.io/package/@ko-fi/handler.md) ^1.0.0

## Recent versions

- 1.0.2 (latest) — 2022-10-18
- 1.0.1 — 2022-10-17
- 1.0.0 — 2022-10-17

## README

Ko-fi webhook handler for Next.js.

For more information visit https://ko-fi.com/manage/webhooks

---

## Installation

### npm

`npm install @ko-fi/next`

### yarn

`yarn add @ko-fi/next`

## Example

View example implementation [here](https://github.com/oneso/ko-fi-next-example);

#### Create API Route, e.g `pages/api/webhook.js`

    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',
    });

---
_Source: https://npm.io/package/@ko-fi/next · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
