---
title: "nuxt-backend and nuxt-convex-module"
description: "What nuxt-backend takes from nuxt-convex-module as it is, what it renames to a neutral name, the base options it sets, and how the pair maps to the official React and Next integration."
canonical_url: "https://nuxt-backend.dev/docs/start/concepts/nuxt-convex-module"
---
# nuxt-backend and nuxt-convex-module

> What nuxt-backend takes from nuxt-convex-module as it is, what it renames to a neutral name, the base options it sets, and how the pair maps to the official React and Next integration.

Version: nuxt-backend 0.6.x · Tab: Start · Kind: concept · Status: stable

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

[`nuxt-convex-module`](https://github.com/qruto/nuxt-convex-module) is the base module under `nuxt-backend`: the generic Convex integration for Nuxt, with live queries and mutations, server rendering, the auth plumbing, DevTools and a Convex-aware content security policy. `nuxt-backend` installs and configures it as its own dependency, adds the twelve [capabilities](https://nuxt-backend.dev/docs/start/concepts/capabilities) on top, and puts one neutral name on each concept, so an app never needs both sets of names.

## What passes through unchanged

The base module's data composables and auth components keep their names and their guarantees, documented by the base module and listed in [Composables](https://nuxt-backend.dev/docs/reference/nuxt/composables):

- **Queries and mutations:** `useQuery`, `useQueries`, `useMutation`, `useAction`, `usePaginatedQuery`, `useAsyncQuery`, `useAsyncPaginatedQuery`.
- **Server rendering:** `usePreloadedQuery`, `usePreloadedAuthQuery`.
- **Files:** `useUpload`, `useUploadQueue`, `useStorageUrl`. You pass `useUpload` and `useUploadQueue` the package's `generateUploadUrl`, and `useStorageUrl` a query that returns a file's URL, with its storage id. nuxt-backend's `useUploadField`, and `<UploadField>` around it, run `useUploadQueue` one file at a time with a claim step of your own ([Accept checked uploads](https://nuxt-backend.dev/docs/build/data/files/checked-uploads)).
- **Auth state:** `useConvexAuth`, and the `<Authenticated>`, `<Unauthenticated>` and `<AuthLoading>` boundaries.

## What is renamed

Every name of the base module that says the platform's or a provider's name is hidden, and the concept keeps one neutral name:

<table>
<thead>
  <tr>
    <th>
      The base module's
    </th>
    
    <th>
      In an app with nuxt-backend
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        useConvex
      </code>
    </td>
    
    <td>
      <code>
        useBackendClient
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        useConvexConnectionState
      </code>
    </td>
    
    <td>
      <code>
        useConnectionState
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        useBetterAuth
      </code>
    </td>
    
    <td>
      <code>
        useAuth
      </code>
      
      , which reads the session and signs out, and <code>
        useLoginFlow
      </code>
      
      , the one way to sign in
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        <ConvexImage>
      </code>
    </td>
    
    <td>
      <code>
        <StorageImage>
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        <CheckoutLink>
      </code>
      
      , <code>
        <CustomerPortalLink>
      </code>
    </td>
    
    <td>
      <code>
        <BillingCheckoutLink>
      </code>
      
      , <code>
        <BillingPortalLink>
      </code>
      
      , bound to this package's checkout and portal
    </td>
  </tr>
  
  <tr>
    <td>
      The <code>
        convex-auth
      </code>
      
       route middleware
    </td>
    
    <td>
      <code>
        definePageMeta({ auth })
      </code>
      
      , with no named middleware
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        convexBetterAuthNuxt
      </code>
      
       (Nitro)
    </td>
    
    <td>
      <code>
        backendAuth
      </code>
    </td>
  </tr>
</tbody>
</table>

The rest of the brand-named surface (`useConvexQuery`, `provideConvexAuth`, …) stays an explicit import from `nuxt-convex-module` for the rare app that needs it. In development, an old component name still renders its replacement and warns once with the new name.

## The options it sets

`nuxt-backend` passes its own configuration to the base module and sets four of its options:

- **betterAuth**: on, with this package's passwordless client (sign-in codes and passkeys). Your own `convex.betterAuth` object is spread over it, so a field you set wins.
- **polar**: on, for the billing integration, with the checkout and portal links bound to this package's billing functions. The other auth integrations stay off, so a second auth provider is never auto-detected.
- **security**: on, so every app gets the security headers and the content security policy, from `nuxt-security`, which this package installs. The policy is nonce-based, and a production build requires Trusted Types ([Content Security Policy](https://nuxt-backend.dev/docs/ship/security#content-security-policy)). `security: false` in `nuxt.config` still switches it off.
- **devScript**: off. The base module would rewrite the `dev` script to `convex dev --start "nuxt dev"`, which never starts Nuxt on a new deployment of this package ([Run the dev loop](https://nuxt-backend.dev/docs/develop/dev-loop#why-a-dev-command-of-its-own)).

Keep a `nuxt-convex-module` entry you already have in `modules`, with its options: they merge with these.

## Official integration parity

`nuxt-backend` ports the official Better Auth integration for Convex's React and Next clients to Vue and Nuxt, with each moving part given a Nuxt default:

<table>
<thead>
  <tr>
    <th>
      Official React/Next piece
    </th>
    
    <th>
      Nuxt/Vue equivalent
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Manual Better Auth component files
    </td>
    
    <td>
      The packaged <code>
        nuxt-backend/convex.config
      </code>
      
      , mounted by the scaffolded <code>
        backend/convex.config.ts
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        auth.config.ts
      </code>
      
       with the Better Auth provider
    </td>
    
    <td>
      <code>
        nuxt-backend/auth.config
      </code>
      
      , scaffolded as <code>
        backend/auth.config.ts
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        auth.ts
      </code>
      
       with <code>
        authComponent
      </code>
      
      , <code>
        createAuth
      </code>
      
       and the auth queries
    </td>
    
    <td>
      The scaffolded <code>
        backend/auth.ts
      </code>
      
      , built on <code>
        setupAuth(...)
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      A Better Auth client with <code>
        convexClient()
      </code>
    </td>
    
    <td>
      The Vue Better Auth client the module creates, behind <code>
        useAuth()
      </code>
      
       and <code>
        useLoginFlow()
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        ConvexBetterAuthProvider
      </code>
    </td>
    
    <td>
      A Nuxt client plugin, and the base module's <code>
        useConvexAuth()
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      The Next route handler proxy
    </td>
    
    <td>
      A Nuxt server proxy at <code>
        backend.authRoute
      </code>
      
       (<code>
        /api/auth
      </code>
      
       by default)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        convexBetterAuthNextJs()
      </code>
    </td>
    
    <td>
      <code>
        backendAuth(event)
      </code>
      
       in Nuxt server handlers (<code>
        nuxt/server
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        usePreloadedAuthQuery()
      </code>
    </td>
    
    <td>
      <code>
        usePreloadedAuthQuery()
      </code>
      
      , for Vue hydration
    </td>
  </tr>
</tbody>
</table>

## What this means for you

- Read `nuxt-convex-module`'s docs for what passes through, and these for everything else: [Queries and mutations](https://nuxt-backend.dev/docs/build/data/read-write) shows both together.
- Moving an app that uses the base module alone: install this package, and the renames above are what changes in your code ([Installation](https://nuxt-backend.dev/docs/start/installation)).
- For the Convex bindings alone, without the capabilities, use `nuxt-convex-module` on its own.


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
