Skip to content
masterclass Buddy

Better Auth · Function

customSession

The customSession plugin lets you add or change fields returned by getSession and useSession. Use customSessionClient to expose the added fields to client-side types.

Last updated

Syntax

customSession(async ({ user, session }, ctx) => ({ user, session, ...customFields }), options, pluginOptions)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • getSession
  • useSession
  • customSessionClient
  • multi-session/list-device-sessions
  • shouldMutateListDeviceSessionsEndpoint
  • BetterAuthOptions

Source: Session Management. Checked 2026-11-03.