[PR #5184] [MERGED] refactor: move client plugin types to core #31433

Closed
opened 2026-04-17 22:18:21 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5184
Author: @himself65
Created: 10/9/2025
Status: Merged
Merged: 10/9/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/10/09/client


📝 Commits (2)

  • 1d1397c refactor: move client plugin types to core
  • fa9e22d expect: error

📊 Changes

40 files changed (+310 additions, -258 deletions)

View changed files

📝 packages/better-auth/src/client/config.ts (+9 -3)
📝 packages/better-auth/src/client/index.ts (+2 -2)
📝 packages/better-auth/src/client/lynx/index.ts (+19 -18)
📝 packages/better-auth/src/client/path-to-object.ts (+8 -8)
📝 packages/better-auth/src/client/plugins/infer-plugin.ts (+1 -1)
📝 packages/better-auth/src/client/proxy.ts (+1 -1)
📝 packages/better-auth/src/client/react/index.ts (+19 -18)
📝 packages/better-auth/src/client/solid/index.ts (+20 -18)
📝 packages/better-auth/src/client/svelte/index.ts (+19 -18)
📝 packages/better-auth/src/client/test-plugin.ts (+1 -1)
📝 packages/better-auth/src/client/types.ts (+61 -105)
📝 packages/better-auth/src/client/vanilla.ts (+19 -18)
📝 packages/better-auth/src/client/vue/index.ts (+21 -20)
📝 packages/better-auth/src/plugins/additional-fields/client.ts (+2 -1)
📝 packages/better-auth/src/plugins/admin/client.ts (+1 -1)
📝 packages/better-auth/src/plugins/anonymous/client.ts (+1 -1)
📝 packages/better-auth/src/plugins/api-key/client.ts (+1 -1)
📝 packages/better-auth/src/plugins/device-authorization/client.ts (+1 -1)
📝 packages/better-auth/src/plugins/email-otp/client.ts (+1 -1)
📝 packages/better-auth/src/plugins/generic-oauth/client.ts (+1 -1)

...and 20 more files

📄 Description

Summary by cubic

Centralized all client plugin-related types in @better-auth/core to remove duplication and simplify imports across client packages. This is a type-only refactor with no runtime behavior changes.

  • Refactors

    • Added core/types/plugin-client.ts exporting BetterAuthClientPlugin, BetterAuthClientOptions, ClientStore, and ClientAtomListener.
    • Updated all client modules (vanilla, React, Vue, Svelte, Solid, Lynx) and plugins to import client types from @better-auth/core.
    • Replaced ClientOptions with BetterAuthClientOptions and AtomListener with ClientAtomListener across the codebase.
    • Kept deprecated aliases in better-auth/client/types.ts for compatibility.
    • Updated getClientConfig to use BetterAuthClientOptions.
    • Exposed new client types via @better-auth/core/src/types/index.ts.
    • Added nanostores as a core dependency to support shared client types.
  • Migration

    • Update imports in apps and custom plugins to use BetterAuthClientPlugin, BetterAuthClientOptions, ClientStore, and ClientAtomListener from @better-auth/core.
    • Replace any usage of ClientOptions with BetterAuthClientOptions and AtomListener with ClientAtomListener.

🔄 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/5184 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/9/2025 **Status:** ✅ Merged **Merged:** 10/9/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/10/09/client` --- ### 📝 Commits (2) - [`1d1397c`](https://github.com/better-auth/better-auth/commit/1d1397ca510e18a18f3af65d4931e1ea39b135a2) refactor: move client plugin types to core - [`fa9e22d`](https://github.com/better-auth/better-auth/commit/fa9e22dba201b0cd7c75d3803441ecae3ca16333) expect: error ### 📊 Changes **40 files changed** (+310 additions, -258 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/client/config.ts` (+9 -3) 📝 `packages/better-auth/src/client/index.ts` (+2 -2) 📝 `packages/better-auth/src/client/lynx/index.ts` (+19 -18) 📝 `packages/better-auth/src/client/path-to-object.ts` (+8 -8) 📝 `packages/better-auth/src/client/plugins/infer-plugin.ts` (+1 -1) 📝 `packages/better-auth/src/client/proxy.ts` (+1 -1) 📝 `packages/better-auth/src/client/react/index.ts` (+19 -18) 📝 `packages/better-auth/src/client/solid/index.ts` (+20 -18) 📝 `packages/better-auth/src/client/svelte/index.ts` (+19 -18) 📝 `packages/better-auth/src/client/test-plugin.ts` (+1 -1) 📝 `packages/better-auth/src/client/types.ts` (+61 -105) 📝 `packages/better-auth/src/client/vanilla.ts` (+19 -18) 📝 `packages/better-auth/src/client/vue/index.ts` (+21 -20) 📝 `packages/better-auth/src/plugins/additional-fields/client.ts` (+2 -1) 📝 `packages/better-auth/src/plugins/admin/client.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/anonymous/client.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/api-key/client.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/device-authorization/client.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/email-otp/client.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/generic-oauth/client.ts` (+1 -1) _...and 20 more files_ </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Centralized all client plugin-related types in @better-auth/core to remove duplication and simplify imports across client packages. This is a type-only refactor with no runtime behavior changes. - **Refactors** - Added core/types/plugin-client.ts exporting BetterAuthClientPlugin, BetterAuthClientOptions, ClientStore, and ClientAtomListener. - Updated all client modules (vanilla, React, Vue, Svelte, Solid, Lynx) and plugins to import client types from @better-auth/core. - Replaced ClientOptions with BetterAuthClientOptions and AtomListener with ClientAtomListener across the codebase. - Kept deprecated aliases in better-auth/client/types.ts for compatibility. - Updated getClientConfig to use BetterAuthClientOptions. - Exposed new client types via @better-auth/core/src/types/index.ts. - Added nanostores as a core dependency to support shared client types. - **Migration** - Update imports in apps and custom plugins to use BetterAuthClientPlugin, BetterAuthClientOptions, ClientStore, and ClientAtomListener from @better-auth/core. - Replace any usage of ClientOptions with BetterAuthClientOptions and AtomListener with ClientAtomListener. <!-- 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-17 22:18:21 -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#31433