[PR #6664] [CLOSED] docs: useSession hook is a field not a method #6810

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6664
Author: @zekariyasamdu
Created: 12/10/2025
Status: Closed

Base: canaryHead: docs/change


📝 Commits (3)

  • b9d1d60 docs: useSession hook is a field not a method
  • bf6b214 docs: framework specific clients
  • aff3b05 Merge branch 'canary' into docs/change

📊 Changes

1 file changed (+13 additions, -0 deletions)

View changed files

📝 docs/content/docs/concepts/client.mdx (+13 -0)

📄 Description

When using useSession as suggested in the docs like this.

 const { data: session } = authClient.useSession();

It causes a typescript error saying " This expression is not callable ".

fix: call the get() method on useSession to get session data,

 const { data: session } = authClient.useSession.get();

Summary by cubic

Corrected the docs for useSession: it’s a field with a get() method, not a callable hook. Updated examples to use authClient.useSession.get() to avoid the TypeScript “not callable” error, and added a Framework-Specific Clients section with correct import sources (client, react, svelte-kit, vue, tanstack-start) plus a note that framework packages expose reactive features like React Hooks.

Written for commit aff3b05b50. Summary will update 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/6664 **Author:** [@zekariyasamdu](https://github.com/zekariyasamdu) **Created:** 12/10/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `docs/change` --- ### 📝 Commits (3) - [`b9d1d60`](https://github.com/better-auth/better-auth/commit/b9d1d6072cedb641bd9ad67d2b8c5733c4720717) docs: useSession hook is a field not a method - [`bf6b214`](https://github.com/better-auth/better-auth/commit/bf6b214ad8a14b110f2d533433f813ad594355af) docs: framework specific clients - [`aff3b05`](https://github.com/better-auth/better-auth/commit/aff3b05b5056ae6758617f225a488592f5be3e37) Merge branch 'canary' into docs/change ### 📊 Changes **1 file changed** (+13 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/concepts/client.mdx` (+13 -0) </details> ### 📄 Description When using useSession as suggested in the docs like this. ``` const { data: session } = authClient.useSession(); ``` It causes a typescript error saying " This expression is not callable ". fix: call the get() method on useSession to get session data, ``` const { data: session } = authClient.useSession.get(); ``` <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Corrected the docs for useSession: it’s a field with a get() method, not a callable hook. Updated examples to use authClient.useSession.get() to avoid the TypeScript “not callable” error, and added a Framework-Specific Clients section with correct import sources (client, react, svelte-kit, vue, tanstack-start) plus a note that framework packages expose reactive features like React Hooks. <sup>Written for commit aff3b05b5056ae6758617f225a488592f5be3e37. Summary will update 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-03-13 13:12:33 -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#6810