[PR #4138] [MERGED] feat: support custom schema merging in SIWE plugin #5213

Closed
opened 2026-03-13 12:14:22 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4138
Author: @himself65
Created: 8/21/2025
Status: Merged
Merged: 8/21/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/08/21/custom-db


📝 Commits (1)

  • cc23d75 feat: support custom schema merging in SIWE plugin

📊 Changes

2 files changed (+72 additions, -2 deletions)

View changed files

📝 packages/better-auth/src/plugins/siwe/index.ts (+4 -2)
📝 packages/better-auth/src/plugins/siwe/siwe.test.ts (+68 -0)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/4124


Summary by cubic

Adds custom schema merging to the SIWE plugin, letting apps map the walletAddress model and fields to their own DB schema via mergeSchema. Backwards compatible; defaults remain unchanged.

  • New Features
    • Added optional schema to SIWEPluginOptions and merged with default via mergeSchema.
    • Supports custom modelName and field names for walletAddress.
    • Updated types with InferOptionSchema.
    • Added tests covering custom schema mapping and end-to-end verify flow.

🔄 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/4138 **Author:** [@himself65](https://github.com/himself65) **Created:** 8/21/2025 **Status:** ✅ Merged **Merged:** 8/21/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/08/21/custom-db` --- ### 📝 Commits (1) - [`cc23d75`](https://github.com/better-auth/better-auth/commit/cc23d75c2307a330f22218e9c7f9977559c550b9) feat: support custom schema merging in SIWE plugin ### 📊 Changes **2 files changed** (+72 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/siwe/index.ts` (+4 -2) 📝 `packages/better-auth/src/plugins/siwe/siwe.test.ts` (+68 -0) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/4124 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds custom schema merging to the SIWE plugin, letting apps map the walletAddress model and fields to their own DB schema via mergeSchema. Backwards compatible; defaults remain unchanged. - **New Features** - Added optional schema to SIWEPluginOptions and merged with default via mergeSchema. - Supports custom modelName and field names for walletAddress. - Updated types with InferOptionSchema. - Added tests covering custom schema mapping and end-to-end verify flow. <!-- 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-03-13 12:14:22 -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#5213