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, pluginsuseConvexAuth().client
Application profile or projectionuseConvexQuery(query, args)
Auth-state renderingNative Vue conditionals
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 only by an options object with one exact public origin:

ts
convex: {
  auth: {
    origin: process.env.SITE_URL ?? 'http://localhost:3000'
  }
}

Omit auth for a direct Convex-only application:

ts
convex: {
}

A no-auth build does not register Better Auth runtime plugins, proxy handlers, route middleware, auth auto-imports, or auth types. auth: false is reserved for a Nuxt configuration layer that must erase an inherited auth object.

Start here