It doesn't seem possible to use a default config and export to multiple apps while maintaining type inference (i.e. loses additional fields etc.). Is there something I'm doing wrong or is it just not implemented to work like that?
Also, if I try to return without explicitly setting the return value as "BetterAuthOptions" it gives this error:
The inferred type of 'getAuthDefaults' cannot be named without a reference to '../nodemodules/better-auth/dist/shared/better-auth.Bzjh9zg'. This is likely not portable. A type annotation is necessary.ts(2742) The inferred type of 'getAuthDefaults' cannot be named without a reference to '../node_modules/better-auth/dist/shared/better-auth.Cl08k4BO'. This is likely not portable. A type annotation is necessary.ts(2742)
On the client side, I am adding "inferAdditionalFields<typeof auth>()" to my plugins array as described in the docs - and it works if I copy and paste the default config into the app specific better auth config directly, but then fails to infer if I import it and spread it into it
Is this suited for github? Yes, this is suited for github To Reproduce setup better-auth in express node application. Current vs. Expected behavior The inferred type of 'auth' cannot be nam...