[PR #5570] [CLOSED] feat: replace zod type with standard schema #14338

Closed
opened 2026-04-13 09:25:31 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5570
Author: @R5dan
Created: 10/25/2025
Status: Closed

Base: canaryHead: standard-schema


📝 Commits (3)

📊 Changes

2 files changed (+77 additions, -3 deletions)

View changed files

📝 packages/core/src/db/type.ts (+3 -3)
packages/core/src/types/standard-schema.ts (+74 -0)

📄 Description

Adds standard schema to better auth


Summary by cubic

Introduce a vendor-agnostic Standard Schema v1 for field validation. This removes the Zod dependency in DB validators and standardizes validate calls across core and better-auth.

  • Refactors

    • Added StandardSchemaV1 interface (core/types/standard-schema.ts).
    • Replaced ZodType with StandardSchemaV1 for DBFieldAttributeConfig.validator input/output.
    • Updated better-auth parseInputData to call schema["~standard"].validate(...).
  • Migration

    • Update any custom DB field validators to implement Standard Schema v1 or wrap existing Zod schemas.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5570 **Author:** [@R5dan](https://github.com/R5dan) **Created:** 10/25/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `standard-schema` --- ### 📝 Commits (3) - [`3347285`](https://github.com/better-auth/better-auth/commit/334728592331ec4ffbc0104228e611329620f41c) standard schema - [`490e574`](https://github.com/better-auth/better-auth/commit/490e5741e39bd5882ded03b8350ee32ec3e43727) chore: lint - [`5f78d57`](https://github.com/better-auth/better-auth/commit/5f78d576a55c31fed2f20d126108d8b6116e551c) Merge branch 'canary' into standard-schema ### 📊 Changes **2 files changed** (+77 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/db/type.ts` (+3 -3) ➕ `packages/core/src/types/standard-schema.ts` (+74 -0) </details> ### 📄 Description Adds standard schema to better auth <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Introduce a vendor-agnostic Standard Schema v1 for field validation. This removes the Zod dependency in DB validators and standardizes validate calls across core and better-auth. - **Refactors** - Added StandardSchemaV1 interface (core/types/standard-schema.ts). - Replaced ZodType with StandardSchemaV1 for DBFieldAttributeConfig.validator input/output. - Updated better-auth parseInputData to call schema["~standard"].validate(...). - **Migration** - Update any custom DB field validators to implement Standard Schema v1 or wrap existing Zod schemas. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 09:25:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#14338