๐FREEIntermediate
CLERK + PRISMA USER SYNC
Clerk webhooks โ Prisma upsert. Drop-in Next.js route handler.
Single TypeScript file. Verifies the Clerk Svix signature, parses the webhook payload with proper TypeScript types, and runs Prisma upsert (create/update) or deleteMany (delete) โ idempotent because upsert handles Clerk's at-least-once delivery. Includes the reference Prisma User model in a JSDoc setup block, plus the skip-on-no-email edge case so Clerk doesn't retry forever for users without an email yet.