What is the betterAuth({}) type?
Hi community,
Let's say we need to propagate our auth const, send through some context, whatever. How can we actually define the type returned by
betterAuth({})
?8 Replies
better auth returns a generic, so it doesn't have consistent type. But you can import
Auth
from better-auth
as a general type just don't cast the auth instance to it.Unknown User•3w ago
Message Not Public
Sign In & Join Server To View
you can define additional fields
https://www.better-auth.com/docs/concepts/database#extending-core-schema
Database | Better Auth
Learn how to use a database with Better Auth.
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View
TypeScript | Better Auth
Better Auth TypeScript integration.
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View
Remove the
callbacks
and take a look at https://www.better-auth.com/docs/concepts/session-management#customizing-session-responseSession Management | Better Auth
Better Auth session management.
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View