Webhook Routes
Incoming webhook handlers.
Stripe webhook
POST /api/webhooks/stripe
Handles incoming Stripe webhook events. This route is excluded from middleware processing.
Events handled:
checkout.session.completed— Activates paid plans and promotionspayment_intent.succeeded— Confirms successful payments
Security: Validates the stripe-signature header using STRIPE_WEBHOOK_SECRET.
Outgoing webhooks
DirectoryKit also sends outgoing webhook notifications:
import { webhookEvents } from '@/lib/webhooks'
await webhookEvents.projectSubmitted(project)
await webhookEvents.projectApproved(project)Configure Discord webhooks via DISCORD_WEBHOOK_URL.