Infer type is empty in hono

In the auth.ts file , while following the hono better-auth docs. It states to infer the user and session type use auth.$infer.

But in my case that is an empty object. I am binding that to Hono app by const app = new Hono<{Binding: AuthType}> which according to docs should set the type for users and session.

this is the type that i get back when using auth.api.getSession()
const session: {
    session: unknown;
    user: unknown;
} | null

why is it unknown ?
Solution
hello
also check your config (like empty plugins array etc), had this kind of errors before too
Was this page helpful?