[PR #8733] feat(client): add hydrateSession for SSR session hydration #25079

Open
opened 2026-04-15 22:43:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8733
Author: @bytaesu
Created: 3/22/2026
Status: 🔄 Open

Base: mainHead: 2026-03-23/feat/hydrate-session


📝 Commits (1)

  • a03379d feat(client): add hydrateSession for SSR session hydration

📊 Changes

10 files changed (+245 additions, -3 deletions)

View changed files

📝 docs/content/docs/concepts/client.mdx (+40 -0)
📝 packages/better-auth/src/client/client.test.ts (+161 -0)
📝 packages/better-auth/src/client/config.ts (+6 -1)
📝 packages/better-auth/src/client/lynx/index.ts (+3 -0)
📝 packages/better-auth/src/client/react/index.ts (+3 -0)
📝 packages/better-auth/src/client/session-atom.ts (+20 -2)
📝 packages/better-auth/src/client/solid/index.ts (+3 -0)
📝 packages/better-auth/src/client/svelte/index.ts (+3 -0)
📝 packages/better-auth/src/client/vanilla.ts (+3 -0)
📝 packages/better-auth/src/client/vue/index.ts (+3 -0)

📄 Description

Since createAuthClient is created once at the module level, using initialData is a bit tricky.

So I'm thinking of solving this with hydrateSession method that runs after initialization.


🔄 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/8733 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 3/22/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `2026-03-23/feat/hydrate-session` --- ### 📝 Commits (1) - [`a03379d`](https://github.com/better-auth/better-auth/commit/a03379d0edc9b7f30dd4813ee4d88de6aa8b98da) feat(client): add hydrateSession for SSR session hydration ### 📊 Changes **10 files changed** (+245 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/concepts/client.mdx` (+40 -0) 📝 `packages/better-auth/src/client/client.test.ts` (+161 -0) 📝 `packages/better-auth/src/client/config.ts` (+6 -1) 📝 `packages/better-auth/src/client/lynx/index.ts` (+3 -0) 📝 `packages/better-auth/src/client/react/index.ts` (+3 -0) 📝 `packages/better-auth/src/client/session-atom.ts` (+20 -2) 📝 `packages/better-auth/src/client/solid/index.ts` (+3 -0) 📝 `packages/better-auth/src/client/svelte/index.ts` (+3 -0) 📝 `packages/better-auth/src/client/vanilla.ts` (+3 -0) 📝 `packages/better-auth/src/client/vue/index.ts` (+3 -0) </details> ### 📄 Description Since `createAuthClient` is created once at the module level, using `initialData` is a bit tricky. So I'm thinking of solving this with `hydrateSession` method that runs after initialization. --- <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-15 22:43:01 -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#25079