---
title: "Why We Transitioned to Clerk for Authentication"
description: "Turso replaced its homegrown GitHub-only auth with Clerk to add Google login, passkeys, MFA and SSO/SAML without building auth in-house, choosing it over Auth.js, Auth0, Kinde and Hanko mainly for its hosted Account Portal and tight Next.js middleware integration."
url: "https://swe.quest/articles/why-we-transitioned-to-clerk-for-authentication-4bd2beb9723f2c95"
canonical: "https://turso.tech/blog/why-we-transitioned-to-clerk-for-authentication"
source: "Turso"
published: "2024-08-15"
difficulty: "medium"
kind: "Case study"
reading_minutes: 3
tags: ["identity-auth"]
---

# Why We Transitioned to Clerk for Authentication

A post on [Turso](https://swe.quest/sources/turso.md), published 2024-08-15, 3 min read, Case study. Original: [https://turso.tech/blog/why-we-transitioned-to-clerk-for-authentication](https://turso.tech/blog/why-we-transitioned-to-clerk-for-authentication)

## Summary

Turso replaced its homegrown GitHub-only auth with Clerk to add Google login, passkeys, MFA and SSO/SAML without building auth in-house, choosing it over Auth.js, Auth0, Kinde and Hanko mainly for its hosted Account Portal and tight Next.js middleware integration. For the CLI, Clerk's one-minute session cookies were unsuitable, so they used JWT templates to issue 7-day long-lived tokens. Migration ran in three phases (dual-writing new users, bulk migrating existing users with Clerk's script, then cutting over), and users whose GitHub email had changed unnoticed were conservatively locked out to prevent account takeover. Next they plan to move from Account Portal to Clerk Elements for full UI customization.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Identity & auth](https://swe.quest/tags/identity-auth.md) (Security)

## Prerequisites

- OAuth login flows ([easy posts on Identity & auth](https://swe.quest/tags/identity-auth.md?difficulty=easy))
- JWT basics

## Keywords

Clerk, Turso, Next.js, Auth.js, JWT, passkeys, SAML

## Related posts

- [Next.js authentication using Clerk, Drizzle ORM, and Neon](https://swe.quest/articles/next-js-authentication-using-clerk-drizzle-orm-and-neon-0a85f87be532db48.md): Neon · 2024-04-01 · Medium · 9 min read · Identity & auth, React, PostgreSQL, TypeScript, Serverless
  Clerk can handle authentication for a Next.js 14 App Router app while Drizzle ORM and Neon's serverless HTTP driver store non-PII data keyed by the Clerk user ID.
- [How to Build a Secure Project Management Platform with Next.js, Clerk, and Neon](https://swe.quest/articles/how-to-build-a-secure-project-management-platform-with-next-js-clerk-and-neon-a23e4da79b231f5e.md): Neon · 2025-02-22 · Medium · 29 min read · Identity & auth, React, PostgreSQL, Application security, Frontend
  A security-first tutorial for building Kozi, a collaborative project management app, using Next.js, Clerk authentication and a Neon serverless Postgres database accessed through Prisma.
- [Auth setup with Neon, Keycloak and Koyeb](https://swe.quest/articles/auth-setup-with-neon-keycloak-and-koyeb-120106d3cf82095b.md): Neon · 2023-12-15 · Medium · 5 min read · Identity & auth, PostgreSQL, Deployment
  Keycloak can use Neon serverless Postgres as its backing store, with the Keycloak server deployed as a container on Koyeb.
- [Solving the MCP Authentication Headache with Vercel & Better Auth](https://swe.quest/articles/solving-the-mcp-authentication-headache-with-vercel-better-auth-749640ed1439e99c.md): Neon · 2025-05-23 · Medium · 5 min read · Identity & auth, AI agents, TypeScript
  Remote MCP servers can authenticate users with OAuth instead of plaintext bearer tokens or UUIDs stored in a client's mcp.json, using Better Auth's MCP plugin together with Vercel's @vercel/mcp-adapter in a Next.js app.
- [Handling Auth in a Staging Environment](https://swe.quest/articles/handling-auth-in-a-staging-environment-18efe1e68fa29994.md): Neon · 2026-01-10 · Medium · 7 min read · Identity & auth, PostgreSQL, CI/CD, Testing
  Neon Auth stores users, sessions and OAuth data in a neon\_auth schema inside the Postgres database, so branching the database also branches auth state via copy-on-write.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
