how to return more data from `/get-session`
hello, I would want to store user's balance inside session object, instead of fetching it manually
I tried to create a plugin for better auth, but it doesn't work (it worked a few days before, I didn't change code nor updated dependencies...)
so my question is, how to store more data in the session object?
2 Replies
If I'm not mistaken you don't need to create a custom plugin, all you need to do is to extend session with CustomSession built-in plugin:
Docs link to this: https://www.better-auth.com/docs/concepts/session-management#customizing-session-response
Session Management | Better Auth
Better Auth session management.
did you tried inferring fields?