Skip to content

Instantly share code, notes, and snippets.

View domitriusclark's full-sized avatar
🏃‍♂️
Lost in the code

Domitrius domitriusclark

🏃‍♂️
Lost in the code
View GitHub Profile
@gragland
gragland / stripe-webhook.js
Last active January 18, 2024 22:20
Next.js Stripe Webhook from divjoy.com
const getRawBody = require("raw-body");
const { updateUserByCustomerId } = require("./_db.js");
const stripe = require("stripe")(process.env.STRIPE_SECRET_KEY, {
apiVersion: process.env.STRIPE_API_VERSION,
});
// Disable next.js body parsing (stripe needs the raw body to validate the event)
export const config = {
api: {