Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

Supabase → Clerk → Better Auth — The 2026 Authentication Migration Playbook for Client Projects

Table of contents · 8 items

In May 2026, an article titled From Supabase to Clerk to Better Auth hit the front page of Hacker News, sparking spirited discussions around a developer's candid experience of "migrating an authentication stack from Supabase to Clerk to Better Auth." It marks a symbolic shift in SaaS authentication selection: "choosing for features → migrating due to pricing → settling on self-controlled OSS."

In our custom development practice, inquiries regarding "auth infrastructure migration" have increased noticeably over the past six months. We are simultaneously fielding requests from clients looking to "migrate away from Auth0, Cognito, or Firebase Auth" and those seeking to "move to Better Auth to maintain in-house control." In this article, we outline a playbook for safely executing auth migrations in custom development.

Why "rethinking SaaS authentication" is happening

Behind the migration away from SaaS authentication lie three structural shifts.

ShiftDetailsImpact on custom development
Pricing model volatilityMAU pricing suddenly increasesUnpredictability of monthly costs
Data sovereignty requirementsPII cannot be stored on third-party SaaSMandatory requirement in regulated industries / B2B
Vendor lock-in concernsMigration is difficult due to poor export APIsExit planning left as an afterthought
Maturity of open-source softwarePractical OSS solutions like Better Auth have emergedSelf-hosting becomes a realistic solution
AI agent integrationAgent authentication requirements are increasingCustomizability is essential

In particular, "pricing model volatility" is the most frequent discussion point in custom development; we have seen multiple cases where "monthly costs suddenly tripled before anyone noticed." For development partners budgeting projects based on unit costs agreed upon at contract signing, SaaS price increases present a direct financial deficit risk.

This represents an extension of the mindset of "controlling the authentication layer as an independent component" discussed in Implementing MCP Server OAuth 2.1 Authentication in Client Projects, with growing consensus that "authentication is an area development partners should control themselves."

Decision criteria for selecting a "migration destination" in custom development

Better Auth is not a silver bullet. Below are the decision criteria when selecting a migration destination in custom development projects.

[Better Auth が最適なケース]
  ├ Node.js / TypeScript ベースのプロダクト
  ├ 自前で DB / インフラを握れる体制
  ├ 規制業界(金融 / 医療)
  ├ MAU 10 万超で SaaS 課金が辛い
  └ AI エージェント統合のカスタマイズ要件

[Clerk / Supabase Auth で十分なケース]
  ├ MVP / PoC 段階
  ├ MAU 1 万以下
  ├ 自前運用の体制がない
  ├ 標準的な認証要件のみ
  └ 開発速度最優先

[Auth0 / Cognito が最適なケース]
  ├ Enterprise SSO 必須
  ├ 既存の AWS / Auth0 投資が大きい
  ├ コンプライアンス監査の取得実績重視
  └ MAU の予測が立つ大規模案件

Rather than assuming that "migrating to Better Auth solves everything," the development partner's responsibility lies in making a selection tailored to the project's phase and team capabilities.

Standard migration flow for custom development — Switching safely in four phases

Authentication migrations represent a major disaster zone where "users could be locked out from logging in." In custom development, we standardize on the following four phases.

[Phase 1: 並行運用 (2〜4 週間)]
  ├ 旧認証 / 新認証を両方有効化
  ├ ログイン時に新側にユーザーをコピー
  ├ ハッシュ移行(パスワード再設定不要)
  └ 全ユーザーの 80% が新側に移行するまで継続

[Phase 2: 新規ユーザー新側 (1〜2 週間)]
  ├ 新規登録は新側のみ
  ├ 既存ユーザーは新旧どちらでもログイン可
  └ 残り 20% を能動的に新側へ誘導

[Phase 3: 旧側読み取り専用 (2〜4 週間)]
  ├ 旧側の新規登録停止
  ├ ログインは新側のみ受付
  ├ 旧側はパスワードリセット用の参照のみ
  └ 残ユーザーをメール通知で誘導

[Phase 4: 旧側停止 (完了)]
  ├ 旧 SaaS の解約
  ├ データのバックアップ取得
  └ 監査ログのアーカイブ

In particular, Phase 1's "hash migration" is the most critical milestone; an operational approach of sending a "password reset email to all users" leads to disasters like a 30% drop in e-commerce sales. By verifying bcrypt and argon2 hash format compatibility in advance, you can achieve a completely transparent migration.

Data integrity — Five checks learned from failure cases

Here are the data integrity check items prone to failure in custom development.

Check itemImpact if overlooked
Email address normalizationThe same user is registered redundantly
Carrying over MFA settingsMFA gets disabled (critical incident)
Social login ID mappingLogging in via Google links to a different user
Sessions and refresh tokensAll users are forcibly logged out
Migration of admin privileges and rolesNobody can access the admin dashboard

In particular, "social login ID mapping" is the point where most incidents occur in custom development. Always verify using both provider_id and email, and establish a manual review workflow when conflicts occur.

This belongs to the same domain as the "handling of authentication credentials" discussed in Operating Source Code Secrets Audits in Custom Development, representing an area that requires doubled vigilance during migration.

"Auth migration clauses" to include in client contracts

When handling authentication migration in custom development contracts, explicitly specify the following clauses.

ClauseDetailsClient alignment points
Migration scopeTarget user count / SSO requirementsAgreement on projected MAU
Downtime allowanceFeasibility and timing of planned maintenanceMaintenance window
Rollback conditionsCriteria for aborting the migrationFailure rate / error rate thresholds
Data retention periodRetention period for legacy platform dataLegal compliance / audit requirements
Liability for damagesScope of liability during login outagesDemarcation of responsibility between contractor and client
AI agent authenticationAPI keys / OAuth for agentsAuth requirements for agent integrations

In particular, unless you clearly define the "rollback criteria" upfront, overreactions occur where "everything is rolled back over the slightest issue." Agree on concrete metrics, such as a failure rate exceeding 0.5% or issues persisting for over 30 minutes.

Five common pitfalls

Pitfall 1: Rehashing password hashes casually

Executing a hash algorithm change like bcrypt → argon2 concurrently with the migration will require all users to re-login. Execute it in two steps: first migrate, then rehash upon subsequent login.

Pitfall 2: Failing to migrate email change history

If the legacy system maintained an email change history, omitting it causes incidents where users "cannot log in using their previous email address" post-migration. Migrate this data into an alias table.

Pitfall 3: Inability to migrate WebAuthn / Passkeys

Because passkeys rely on pairing between device and service, they cannot be migrated across SaaS platforms. Plan from the outset a workflow that prompts all users to re-register.

Pitfall 4: Forgetting to update corporate SSO (SAML / OIDC)

If the SP metadata registered with the IdP retains the legacy URLs, enterprise users will be unable to log in via SSO after migration. Advance notification to enterprise clients is mandatory.

Pitfall 5: AI agent API keys requiring re-issuance on the new platform

In recent custom development projects, authentication for AI agents has become vital. If reissuing API keys and OAuth tokens used by agents is omitted from the migration plan, all agents will halt post-migration.

Conclusion — Entering the era where "owning your auth is the right call"

Authentication is shifting back from the era of "delegating to SaaS and forgetting it" to "owning and controlling it yourself." With the emergence of practical OSS like Better Auth, self-hosting has become a realistic solution across the three pillars of pricing, data sovereignty, and customizability.

Authentication migration is an area where required effort varies drastically depending on target MAU, presence of SSO/MFA, and regulatory requirements. If you are experiencing issues like "running deficits due to price increases from Auth0 or Cognito" or "wanting to migrate to Better Auth while avoiding migration failures," we provide individualized estimates after evaluating your current architecture. Feel free to contact us via our contact form.

Sources

Share this articleXFacebook
Kakeru Suzuki

Fascinated by the possibilities of technology, has had a deep interest in programming and digital art since student days

Turn this article's theme into your company's next step

Concrete steps forward for your organization.

We organize your desired architecture, legacy systems, and operational requirements to formulate your next steps toward execution.

  • Desired architecture
  • Integration with existing environments
  • Operational requirements
Consult on development & operations initiatives

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles by email