[GH-ISSUE #871] useSession type not working properly #17106

Closed
opened 2026-04-15 15:03:30 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @darklight9811 on GitHub (Dec 13, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/871

Describe the bug
The type for the useSession (on the frontend) is not working properly, it display data as never, the code works as expected returning the session and user data.

To Reproduce
Steps to reproduce the behavior:

  1. Setup the auth client on react
  2. Use the useSession in any component
  3. Try to access any property from data inside useSession

Expected behavior
The session type to display user and session information

Screenshots
image

Desktop (please complete the following information):

  • OS: windows 10
  • Browser [e.g. chrome, safari] (not applicable)
  • Version [e.g. 22] 1.0.18
Originally created by @darklight9811 on GitHub (Dec 13, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/871 **Describe the bug** The type for the useSession (on the frontend) is not working properly, it display data as never, the code works as expected returning the session and user data. **To Reproduce** Steps to reproduce the behavior: 1. Setup the auth client on react 2. Use the useSession in any component 3. Try to access any property from data inside useSession **Expected behavior** The session type to display user and session information **Screenshots** ![image](https://github.com/user-attachments/assets/da163ef3-3d2c-492e-a2bb-4fba1828ec5d) **Desktop (please complete the following information):** - OS: windows 10 - Browser [e.g. chrome, safari] (not applicable) - Version [e.g. 22] 1.0.18
GiteaMirror added the locked label 2026-04-15 15:03:30 -05:00
Author
Owner

@Bekacru commented on GitHub (Dec 13, 2024):

could you please share what plugins you're using on the client?

<!-- gh-comment-id:2540539151 --> @Bekacru commented on GitHub (Dec 13, 2024): could you please share what plugins you're using on the client?
Author
Owner

@darklight9811 commented on GitHub (Dec 13, 2024):

@Bekacru no plugins

image

<!-- gh-comment-id:2541565004 --> @darklight9811 commented on GitHub (Dec 13, 2024): @Bekacru no plugins ![image](https://github.com/user-attachments/assets/7a4f93dc-b382-4645-bce7-c1d7221e73d0)
Author
Owner

@darklight9811 commented on GitHub (Dec 13, 2024):

I'm thinking it may be a typescript config, will try to debug this

<!-- gh-comment-id:2541565639 --> @darklight9811 commented on GitHub (Dec 13, 2024): I'm thinking it may be a typescript config, will try to debug this
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#17106