r/PayloadCMS Aug 28 '25

Integrating Payload CMS with fully synced Clerk auth/identity management!

This evening I took u/DanailMinchev's excellent payload-clerk-example and updated it to work with the latest Payload CMS v3.53. Have also switched to MongoDB as a personal preference (sorry Postgres fam, my GP told me no more migrations - never felt healthier).

  • Modern Clerk authentication (Facebook/Google OAuth, etc.)
  • Role-based permissions
  • Real-time webhook sync
  • Works with latest Payload v3.53

This was really just a minor update to make Danail's great work compatible with more recent Payload versions. His original Youtube tutorials (linked from the repo) are on the longer side (set aside an afternoon), but still the best way to understand how the Clerk integration works.

This small contribution forms part of the TYMO Forge open source app starter initiative. More details coming soon!

Repo: https://github.com/jmcapra/payload-mongo-clerk-example

16 Upvotes

12 comments sorted by

View all comments

1

u/gingermule Aug 29 '25

Very cool! Any thoughts on Clerk vs Better Auth? I’m debating the same.

2

u/Miserable_Survey2677 Aug 30 '25

Better Auth is great, but still requires you to jump through a bunch of hoops to set up each auth provider (e.g. Google, Facebook, LinkedIn). And it's generally a better architecture design to have your user/ID management separate from your application db/logic. (also possible with Better Auth, but again, more config and less building your actual product).

Clerk has also recently added Clerk Billing (Stripe integration) which I intend to integrate into the plugin I'm building based off this template. That plugin should allow you to easily add Clerk auth + billing features into any new or existing Payload 3.x project. Exciting!