4
Related to Stripe integration in directus
Source: directus/directus#25371 · opened by @OveshTappN
Summary I'm trying to implement Stripe webhooks directly within a Directus endpoint (without using a separate Express server). The goal is to listen for events like payment_intent.succeeded, verify the Stripe signature, and update a related Directus collection. The issue I'm facing is: Stripe requires access to the raw request body (Buffer) to verify the signature. But inside Directus, req.body is already parsed into a JavaScript object — meaning the raw body is no longer available, and verification fails with: ❌ Webhook payload must be provided as a string or a Buffer Here’s what I tried: Created a middleware hook in extensions/hooks/stripe-raw-body/index.js to use express.raw() for the /stripe-webhooks route: <img width="1792" alt="Screenshot 2025-06-27 at 5 03 05 PM" src=" /> export default ({ app }) => { app.use('/stripe-webhooks', express.raw({ type: 'application/json' })); }; In the end…
No pledges yet. Be the first to back this.
Comments
Similar requests
Add support for accessing raw request body in custom endpoints
2 votes · 0 comments
Get all related collections/items for m2o,m2m without reverse fields
2 votes · 0 comments
Directus Loader for Astro Content Layer
41 votes · 0 comments
Why Isn't Directus Gaining More Attention in Mobile App Development?
10 votes · 0 comments
Feature Request: Support for Model Context Protocol (MCP)
4 votes · 0 comments
No comments yet.