Back to Decisions

Use Clerk for authentication

Accepted
Sarah Chen2024-01-15
authenticationsecurityinfrastructure
Context
Why this decision needed to be made

Need to implement secure authentication with SSO support for enterprise users. Must support email/password, Google OAuth, and potentially SAML for enterprise clients.

Options Considered
Comparison of available options
OptionProsConsChosen
Auth0
  • Mature platform
  • Excellent SSO support
  • Great documentation
  • Enterprise ready
  • Higher cost at scale ($23/MAU)
  • Vendor lock-in
  • Complex pricing tiers
—
ClerkSelected
  • Modern DX
  • Built-in UI components
  • Good pricing ($0.02/MAU)
  • Easy Next.js integration
  • Newer platform
  • Fewer enterprise features than Auth0
NextAuth.js
  • Open source
  • Self-hosted
  • Flexible
  • No per-user costs
  • More implementation work
  • No built-in UI
  • Need to manage sessions
—
Outcome
What was decided

Selected Clerk for authentication

Rationale
Why this option was chosen

Clerk provides the best balance of features, cost, and developer experience for our timeline. The built-in components save 2-3 weeks of development. Enterprise features are sufficient for Phase 1, and we can migrate if needed.