Skip to content

A Directus extension that supports building flows for Stripe webhooks

License

Notifications You must be signed in to change notification settings

alefinvest/directus-extension-stripe

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

directus-extension-stripe

A Directus extension that allows you to build flows and custom endpoints to handle Stripe Webhooks and make Stripe API calls. The best part is that it's fully integrated with Directus accountability and permissions. It's a small but mighty extension if you are looking to integrate Stripe!

Stripe.Directus.Extension.mp4

Details

This is a bundle extension that contains a middleware hook that verifies the Stripe-Signature header, and an operation node that injects the Stripe secret key into a flow so you can make API requests with the request node e.g. GET https://{{stripe_secret_key}}:@api.stripe.com/v1/customers/{{stripe_customer_id}}.

Check out the example for more details.

Setup Instructions

Once you've installed the extension, to connect Stripe, you can either set the following environment variables:

  • STRIPE_SECRET_KEY: Your Stripe secret key (e.g. sk_...)
  • STRIPE_WEBHOOK_PATH: The path to your webhook, relative to your Directus base URL (e.g. /flows/triggers/...)
  • STRIPE_WEBHOOK_SECRET: Your webhook's secret (e.g. whsec_...)

Or you can configure these variables on the Settings page in Directus:

Settings

NOTE: In order for the settings to appear and for the middleware hook to be installed, you must restart your Directus instance after installing the extension. This is because they rely on the app.before and middleware.before events which only occur when Directus starts.

Marketplace

Currently, this extension is not sandboxed so it won't appear in the Directus Marketplace by default. However, you can set MARKETPLACE_TRUST="all" so the extension becomes visible.

About

A Directus extension that supports building flows for Stripe webhooks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.5%
  • HTML 2.5%