Val Town Migrates Authentication from Clerk to Better Auth
Migrate authentication to Better Auth and remove Clerk.
Migrate to Better Auth and remove Clerk.
Summary
Val Town’s move from Clerk to Better Auth was driven by Clerk’s rate limits, single‑point‑of‑failure design, and misuse of its users table. Clerk imposed a 5 requests per second limit per account, crippling social features that required frequent avatar and username lookups. The platform’s architecture forced developers to sync Clerk data to their own database via webhooks, creating a complex two‑authority system. Clerk’s reliance on JWTs and lack of session tables meant that any outage rendered the entire site unusable, with downtimes lasting minutes to hours. Better Auth, an open‑source solution, offers stateless authentication, no session management, and full control over user data, eliminating vendor risk. The migration required a two‑week overlap where both Clerk and Better Auth were active, with webhooks and API calls adjusted accordingly. Better Auth supports multiple frameworks (Remix, Fastify, Express) and provides a clean, modular integration. The switch reduced complexity, improved reliability, and gave Val Town full ownership of authentication logic.
Key changes
- Clerk rate limit of 5 requests per second per account hindered social features.
- Clerk’s users table forced developers to sync data via webhooks, creating a dual‑authority system.
- Clerk’s single‑point‑of‑failure caused site outages lasting minutes to hours.
- Better Auth is open‑source, stateless, and does not manage sessions, reducing vendor risk.
- Migration required a two‑week overlap with both Clerk and Better Auth active.
- Better Auth supports Remix, Fastify, and Express with clean integration.
- The switch eliminated Clerk’s rate limits and outage risk.
- Val Town gained full control over authentication logic and data.