Skip to main content

Authentication

Choose the Better Convex Nuxt auth API for state, operations, users, routes, and backend policy.

Authentication is optional. When enabled, Better Auth owns the session and Better Convex Nuxt coordinates the identity used by Convex.

Choose the layer

NeedAPI
Current auth status and session useruseConvexAuth()
Sign in, sign up, sign out, refreshuseConvexAuth()
Canonical Better Auth user or app projectionuseConvexUser(query, args)
Declarative auth-state renderingGlobal auth components
Navigation redirectdefinePageMeta({ convexAuth: true })
Query identity policyauth: 'required' | 'optional' | 'none'
Product access enforcementApplication-owned Convex functions
Additional Better Auth client pluginsdefineConvexAuthClient()

Enable or disable auth

Auth is enabled when convex.auth is omitted or an options object:

ts
convex: {
  auth: {
  }
}

Disable it with the boolean literal:

ts
convex: {
  auth: false
}

A disabled build does not register Better Auth runtime plugins, proxy handlers, or route middleware. Auth composables remain auto-imported and return the documented disabled state.

Start here