Stripe webhooks, bodyparser and NextJS

I'm having a real challenge using the Stripe plugin with NextJS, specifically getting the webhook handler to work. I understand that the bodyparser is getting in the way as NextJS route handlers automatically pass the request body through it, which messes with Stripe's signing. In the BetterAuth docs it suggests that exporting a config object is the way to go, i.e.

export const config = {api: {bodyParser: false}}


However, this is deprecated and ignored in the latest versions of NextJS.

The NextJS documentation states that the way to resolve this now is to use request.text() which will bypass bodyparsing. My issue is that all of this is handled internally in the Stripe plugin (which as a concept I love), so I can't see an easy way to do this.

Has anyone else bottomed this out and managed to get it all working?
Was this page helpful?