# ts-stripe-webhook-middleware

> Node.js middleware for processing stripe webhooks

Latest version **0.2.1** (published 2017-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install ts-stripe-webhook-middleware
pnpm add ts-stripe-webhook-middleware
yarn add ts-stripe-webhook-middleware
bun add ts-stripe-webhook-middleware
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2017-02-23 |
| First published | 2017-02-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Eddy Hernandez |
| Maintainers | abacigil |
| Keywords | stripe, payment, middleware, express, connect |

## Links

- npm: https://www.npmjs.com/package/ts-stripe-webhook-middleware
- Repository: https://github.com/TeamSQL/stripe-webhook-middleware
- Issues: https://github.com/TeamSQL/stripe-webhook-middleware/issues
- npm.io page: https://npm.io/package/ts-stripe-webhook-middleware

## Dependencies (1)

- [stripe](https://npm.io/package/stripe.md) latest

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.2.1 (latest) — 2017-02-23

## README

# Stripe Webhook Middleware

Node.js middleware for processing stripe webhooks. Inspired by: [securing stripe webhooks with nodejs](http://gaarf.info/2013/06/25/securing-stripe-webhooks-with-node-js/) & [stripe-webhook-server](https://github.com/ruffrey/stripe-webhook-server).

Currently this middleware only validates events that are sent to it.

Upcoming features include transactional emails, custom templates and support for callbacks (ex: looking up user info by customer data).


### Example Usage

Install node dependencies:

```
npm install express body-parser stripe-webhook-middleware
```

Create `app.js`:

```js
var express = require('express');
var bodyParser = require('body-parser');
var app = express();

var stripeMiddleware = require('stripe-webhook-middleware');

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));

app.post('/stripe', stripeMiddleware.init(app, {
  stripeApiKey: 'your-private-api-key'
}));

app.listen(3000);
```

Run it with `node app.js`. 

Deploy it and add the url to your accounts webhooks - [https://dashboard.stripe.com/account/webhooks](https://dashboard.stripe.com/account/webhooks).

### Supported Stripe Events

- account.updated
- account.application.deauthorized
- application_fee.created
- application_fee.refunded
- balance.available
- charge.succeeded
- charge.failed
- charge.refunded
- charge.captured
- charge.updated
- charge.dispute.created
- charge.dispute.updated
- charge.dispute.closed
- customer.created
- customer.updated
- customer.deleted
- customer.card.created
- customer.card.updated
- customer.card.deleted
- customer.subscription.created
- customer.subscription.updated
- customer.subscription.deleted
- customer.subscription.trial_will_end
- customer.discount.created
- customer.discount.updated
- customer.discount.deleted
- invoice.created
- invoice.updated
- invoice.payment_succeeded
- invoice.payment_failed 
- invoiceitem.created
- invoiceitem.updated
- invoiceitem.deleted
- plan.created
- plan.updated
- plan.deleted
- coupon.created
- coupon.deleted
- recipient.created
- recipient.updated
- recipient.deleted
- transfer.created
- transfer.updated
- transfer.paid
- transfer.failed
- ping

### [LICENSE](LICENSE.md)

---
_Source: https://npm.io/package/ts-stripe-webhook-middleware · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
