Skip to main content
Version: 57.2.0

BetterAuthConfig

Configuration options for Better Auth integration.

Properties

appleOAuth?

optional appleOAuth?: BetterAuthOAuthProvider

Apple OAuth provider configuration.


basePath?

optional basePath?: string

Base path for Better Auth routes.

Default

"/api/auth"

baseURL?

optional baseURL?: string

Base URL for the auth server. If not provided, falls back to BETTER_AUTH_URL environment variable.


crossDomainCookies?

optional crossDomainCookies?: boolean

Allow credential cookies when the frontend and API are hosted on different sites. Enables SameSite=None; Secure cookie attributes. Keep disabled for local HTTP.


enabled

enabled: boolean

Whether Better Auth is enabled for this server.


githubOAuth?

optional githubOAuth?: BetterAuthOAuthProvider

GitHub OAuth provider configuration.


googleOAuth?

optional googleOAuth?: BetterAuthOAuthProvider

Google OAuth provider configuration.


secret?

optional secret?: string

Secret key for Better Auth session encryption. If not provided, falls back to BETTER_AUTH_SECRET environment variable.


trustedOrigins?

optional trustedOrigins?: string[]

Trusted origins for CORS and redirect validation. Include your app's deep link schemes (e.g., "terreno://", "exp://").