Type a provider profile result
An OAuth provider maps its provider profile into the common Auth.js user shape.
Auth.js · Type Alias
User is the Auth.js profile shape returned by an OAuth provider’s profile callback. Auth.js exposes it in JWT and session callbacks, and as the second session-callback parameter for database sessions.
The User type describes the profile object produced by an OAuth provider's profile callback. Auth.js exposes it to JWT and session callbacks, and supplies it as the second session-callback argument when database sessions are used.
interface User {}An interface describing an Auth.js user profile; it is not a callable function and therefore has no runtime return value.
interface User {
id?: string
name?: string | null
email?: string | null
image?: string | null
}Define the optional profile fields returned by an OAuth provider and used by Auth.js callbacks.
An OAuth provider maps its provider profile into the common Auth.js user shape.
A JWT callback reads or enriches the authenticated profile.
A database-backed session callback uses the authenticated user alongside the session.
User describes the object returned by an OAuth provider's profile callback. It is available in jwt and session callbacks, and is passed as the second session-callback argument when using a database.
Follow-up: How should application-specific fields be added? Use TypeScript module augmentation so the shared Auth.js interfaces remain consistent across submodules.
The type represents the provider-derived user profile rather than a database adapter contract. Its documented uses are the provider profile callback, jwt callback, session callback, and database-session callback argument.
Follow-up: What is the related adapter distinction? AdapterUser is the adapter-facing user type used for database operations, while User is the common application-facing profile shape.
Use the User shape when typing values returned from an OAuth provider's profile callback or consumed by Auth.js callbacks. Its fields are optional in the documented interface, so code should handle absent values.
Follow-up: Why are fields optional? Providers can omit profile attributes, so application code should not assume name, email, image, or id is always present.
DefaultUserAdapterUserSessionJWT