swm

stripe-webhooks-middleware

A middleware for express.js that validates incoming Webhooks from Stripe.

Showing:

Popularity

Downloads/wk

1

GitHub Stars

1

Maintenance

Last Commit

5yrs ago

Contributors

1

Package

Dependencies

1

Size (min+gzip)

29.9KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Stripe Webhooks Middleware

A middleware for express.js that validates incoming Webhooks from Stripe.

bitHound Dependencies bitHound Overall Score bitHound Code GitHub license

Usage

Simply use the Stripe Webhooks Middleware as you would any other middleware.

The validated event is available as req.StripeEvent, so you can handle the webhook.

import express from 'express';
import bodyParser from 'body-parser';
import stripeWebhooksMiddleware from 'stripe-webhooks-middleware';

const app = express();

const config = {
  stripeApiSecretKey: 'Your-Stripe-Api-Secret-Key'
};

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

app.post('/stripe', stripeWebhooksMiddleware(config.stripeApiSecretKey));

Example App

You can find an example app in the /examples directory. Run it with npm run example.

Stripe Documentation

For an in-depth overview on Stripe Webhooks see the official Stripe API Documentation.

Copyright 2016 Marcel Fetten. Code released under the MIT license.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100