Getting Started

Client Setup

Create `app/auth.client.ts` to expose a Better Auth client factory.

The module requires a client factory at app/auth.client.ts.
It is aliased as #auth/client and used by useUserSession().

Example

import { createAuthClient } from 'better-auth/vue'
import { adminClient } from 'better-auth/client/plugins'

export function createAppAuthClient(baseURL: string) {
  return createAuthClient({
    baseURL,
    plugins: [adminClient()],
  })
}

export type AppAuthClient = ReturnType<typeof createAppAuthClient>

The module validates this file exists during setup.

See also

  • Better Auth client plugin exports: /better-auth/client-plugins