Skip to content

Instantly share code, notes, and snippets.

View davidsoderberg's full-sized avatar
💻
Coding like a pro

David Söderberg davidsoderberg

💻
Coding like a pro
View GitHub Profile
@cjavilla-stripe
cjavilla-stripe / webhooks.tsx
Created March 25, 2022 13:11
Handle Stripe webhooks in Remix
import Stripe from 'stripe'
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY)
export const action = async ({request}) => {
const secret = 'whsec_...' // process.env.WEBHOOK_SIGNING_SECRET
const sig = request.headers.get('stripe-signature')
let event;
const payload = await request.text()