[PR #6108] [MERGED] feat(client): introduce disableSignal client option #14697

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6108
Author: @ping-maxwell
Created: 11/19/2025
Status: Merged
Merged: 11/21/2025
Merged by: @Bekacru

Base: canaryHead: feat/disable-signal-client-option


📝 Commits (10+)

  • 19a9d6b feat: disable signal client option
  • fad689a fix: type error
  • 06bf18a fix
  • 5cb6681 Merge branch 'canary' into feat/disable-signal-client-option
  • 4d99ecb fix: add promise type to refetch for clients
  • a8427de Merge branch 'canary' into feat/disable-signal-client-option
  • cfa1090 Merge branch 'canary' into feat/disable-signal-client-option
  • 5acdbc0 Merge branch 'canary' into feat/disable-signal-client-option
  • a54727c Merge branch 'canary' into feat/disable-signal-client-option
  • de74996 Merge branch 'canary' into feat/disable-signal-client-option

📊 Changes

11 files changed (+185 additions, -107 deletions)

View changed files

📝 docs/content/docs/concepts/client.mdx (+43 -0)
📝 packages/better-auth/src/client/lynx/index.ts (+1 -1)
📝 packages/better-auth/src/client/path-to-object.ts (+9 -9)
📝 packages/better-auth/src/client/proxy.ts (+9 -6)
📝 packages/better-auth/src/client/query.ts (+80 -75)
📝 packages/better-auth/src/client/react/index.ts (+1 -1)
📝 packages/better-auth/src/plugins/one-tap/client.ts (+6 -4)
📝 packages/core/src/types/index.ts (+1 -0)
📝 packages/core/src/types/plugin-client.ts (+18 -1)
📝 packages/expo/src/client.ts (+7 -4)
📝 packages/passkey/src/client.ts (+10 -6)

📄 Description

This PR adds the addition of disableSignal to prevent specific endpoints from triggering hooks.

Also, refetch from hooks return a promise, allowing users to optionally await a given refetch() call.

// As the second argument
await authClient.updateUser({
    name: "New Name"
}, {
    disableSignal: true
})

// Or within fetchOptions
await authClient.updateUser({
    name: "New Name",
    fetchOptions: {
        disableSignal: true
    }
})

Summary by cubic

Adds a disableSignal option to client fetch requests to prevent hook rerenders (e.g., useSession) on specific calls. Updates docs and makes refetch in useAuthQuery awaitable for manual control.

  • New Features

    • Introduced ClientFetchOption.disableSignal to skip atom signals and hook rerenders on successful requests.
    • Documented usage with examples and manual refetch guidance.
    • useAuthQuery.refetch now returns a Promise.
  • Refactors

    • Replaced BetterFetchOption with ClientFetchOption across clients (core, better-auth, expo, one-tap, passkey).
    • Updated proxy logic to respect fetch options when triggering atom listeners.

Written for commit dcae949eb8. Summary will update automatically on new commits.


🔄 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/6108 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 11/19/2025 **Status:** ✅ Merged **Merged:** 11/21/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `feat/disable-signal-client-option` --- ### 📝 Commits (10+) - [`19a9d6b`](https://github.com/better-auth/better-auth/commit/19a9d6b01b13da36b86a7f718f33fcc038c2c5bf) feat: disable signal client option - [`fad689a`](https://github.com/better-auth/better-auth/commit/fad689a99d682f3646b6c3e0205d5850802e6bad) fix: type error - [`06bf18a`](https://github.com/better-auth/better-auth/commit/06bf18ac8d08a1d91ab6b8aeda9ba35463eb669b) fix - [`5cb6681`](https://github.com/better-auth/better-auth/commit/5cb6681e81cc9911cac860c162716384d7b905d3) Merge branch 'canary' into feat/disable-signal-client-option - [`4d99ecb`](https://github.com/better-auth/better-auth/commit/4d99ecb1eca431c569242c65b3b30a07708141e7) fix: add promise type to refetch for clients - [`a8427de`](https://github.com/better-auth/better-auth/commit/a8427dec36803bd5af41be814f3b70892b281f42) Merge branch 'canary' into feat/disable-signal-client-option - [`cfa1090`](https://github.com/better-auth/better-auth/commit/cfa1090c4deacaf160b9f89ec0b09cf9b1223952) Merge branch 'canary' into feat/disable-signal-client-option - [`5acdbc0`](https://github.com/better-auth/better-auth/commit/5acdbc07153affc717dfa40661ab6fac631dabd0) Merge branch 'canary' into feat/disable-signal-client-option - [`a54727c`](https://github.com/better-auth/better-auth/commit/a54727cc7348405da9a4082c859c65efba77216e) Merge branch 'canary' into feat/disable-signal-client-option - [`de74996`](https://github.com/better-auth/better-auth/commit/de74996ffa857b320ef4af308e07bcd2d8b90ed1) Merge branch 'canary' into feat/disable-signal-client-option ### 📊 Changes **11 files changed** (+185 additions, -107 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/concepts/client.mdx` (+43 -0) 📝 `packages/better-auth/src/client/lynx/index.ts` (+1 -1) 📝 `packages/better-auth/src/client/path-to-object.ts` (+9 -9) 📝 `packages/better-auth/src/client/proxy.ts` (+9 -6) 📝 `packages/better-auth/src/client/query.ts` (+80 -75) 📝 `packages/better-auth/src/client/react/index.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/one-tap/client.ts` (+6 -4) 📝 `packages/core/src/types/index.ts` (+1 -0) 📝 `packages/core/src/types/plugin-client.ts` (+18 -1) 📝 `packages/expo/src/client.ts` (+7 -4) 📝 `packages/passkey/src/client.ts` (+10 -6) </details> ### 📄 Description This PR adds the addition of `disableSignal` to prevent specific endpoints from triggering hooks. Also, `refetch` from hooks return a promise, allowing users to optionally await a given `refetch()` call. ```ts title="auth-client.ts" // As the second argument await authClient.updateUser({ name: "New Name" }, { disableSignal: true }) // Or within fetchOptions await authClient.updateUser({ name: "New Name", fetchOptions: { disableSignal: true } }) ``` <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds a disableSignal option to client fetch requests to prevent hook rerenders (e.g., useSession) on specific calls. Updates docs and makes refetch in useAuthQuery awaitable for manual control. - **New Features** - Introduced ClientFetchOption.disableSignal to skip atom signals and hook rerenders on successful requests. - Documented usage with examples and manual refetch guidance. - useAuthQuery.refetch now returns a Promise. - **Refactors** - Replaced BetterFetchOption with ClientFetchOption across clients (core, better-auth, expo, one-tap, passkey). - Updated proxy logic to respect fetch options when triggering atom listeners. <sup>Written for commit dcae949eb8ffb2db8ca0e156b098b571f3e52317. Summary will update automatically on new commits.</sup> <!-- 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:35: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#14697