Incorrect type inference with additionalFields inside a monorepo

I am using BetterAuth inside the packages directory of my Turborepo.

export type Session = typeof auth.$Infer.Session;
export type User = (typeof auth.$Infer.Session)["user"];


According to the BetterAuth documentation, the Session type should be inferred correctly using typeof auth.$Infer.Session. However, when I hover over User, I get the following inferred type:
type User = {
    id: string;
    email: string;
    emailVerified: boolean;
    name: string;
    createdAt: Date;
    updatedAt: Date;
    image?: string | null | undefined | undefined;
}


This does not include the additional fields I defined in user.additionalFields. Am I missing a step to ensure the custom fields are included in the inferred type?
Better Auth TypeScript integration.
Was this page helpful?