Clerk, Resend, Polar
One provider for every service that signs webhooks the Svix way.
Clerk and Resend deliver webhooks through Svix. Polar uses the compatible Standard Webhooks scheme. The svix() provider covers all of them and accepts both header styles (svix-* and webhook-*). The signing secret is the whsec_ value from the provider's webhook settings page.
app/api/webhooks/clerk/route.ts
import { webhook, svix } from "next-webhooks";
export const POST = webhook({
provider: svix({ name: "clerk", secret: process.env.CLERK_WEBHOOK_SECRET! }),
handler: async (event) => {
if (event.type === "user.created") {
// event.payload.data has the Clerk user object
}
},
});Notes
- Set name so dedupe keys do not collide when you receive svix-style webhooks from more than one provider
- Deliveries are deduplicated by the svix-id header automatically