@neighbourhoodie/nh-hapi-stripe-webhooks

A stripe webhooks endpoint

Usage no npm install needed!

<script type="module">
  import neighbourhoodieNhHapiStripeWebhooks from 'https://cdn.skypack.dev/@neighbourhoodie/nh-hapi-stripe-webhooks';
</script>

README

The Neighbourhoodie Hapi Stripe webhooks

A Hapi plugin for receiving notifications from the Stripe webhooks API.

Stripe can send webhook events that notify your application any time an event happens on your account. The webhooks endpoint will need to authenticate webhooks as per stripe docs.

Installation

npm install @neighbourhoodie/nh-hapi-stripe-webhooks

Usage

server.register({
  register: plugin('@neighbourhoodie/nh-hapi-stripe-webhooks'),
  options: {
    stripeApiKey: 'i_like_broccoli',
    stripeWebhookSecret: 'and_i_dont_lie',
    endpoint: '/webhook',
    webhookHandlers: {
      'stripe.event': callBack
    },
    auth: { strategy: 'session', scope: ['ADMIN'] } // optional, default: false
})

Where Do I find my Stripe API key?

How do I add the webhook endpoint to my stripe dashboard?

Which available stripe events are there?