---
title: "nuxt-backend"
description: "Every export of nuxt-backend, with its signature and where it is defined."
canonical_url: "https://nuxt-backend.dev/docs/reference/api/module"
---
# nuxt-backend

## Interfaces

### ModuleMcpOptions

Defined in: [src/module.ts](https://github.com/qruto/nuxt-backend/blob/main/src/module.ts)

The agent (MCP) surface: an OAuth-protected MCP endpoint served by Nitro
via `@nuxtjs/mcp-toolkit`, with ready-made account/billing/workspace tools
that call Convex as the signed-in user. Everything the tools expose is
already reachable through the product UI under the same user auth; OAuth
adds per-client consent and the deployment's `mcp` rate limit guards the
token exchange.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="route">
        
      </a>
      
       <code>
        route?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      MCP endpoint route. Default <code>
        /mcp
      </code>
      
       (the toolkit's default).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/module.ts" rel="nofollow">
        src/module.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="name">
        
      </a>
      
       <code>
        name?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Server name/description/instructions forwarded to the toolkit.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/module.ts" rel="nofollow">
        src/module.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="description">
        
      </a>
      
       <code>
        description?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/module.ts" rel="nofollow">
        src/module.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="instructions">
        
      </a>
      
       <code>
        instructions?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/module.ts" rel="nofollow">
        src/module.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="sessions">
        
      </a>
      
       <code>
        sessions?
      </code>
    </td>
    
    <td>
      | <code>
        boolean
      </code>
      
       | { <code>
        enabled?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        maxDuration?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        maxSessions?
      </code>
      
      : <code>
        number
      </code>
      
      ; }
    </td>
    
    <td>
      Stateful transport sessions, forwarded to the toolkit. Default off.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/module.ts" rel="nofollow">
        src/module.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="functions">
        
      </a>
      
       <code>
        functions?
      </code>
    </td>
    
    <td>
      <code>
        Partial
      </code>
      
      <<code>
        Record
      </code>
      
      < | <code>
        "getAuthUser"
      </code>
      
       | <code>
        "updateProfile"
      </code>
      
       | <code>
        "getConfiguredProducts"
      </code>
      
       | <code>
        "getCurrentSubscription"
      </code>
      
       | <code>
        "getCredits"
      </code>
      
       | <code>
        "generateCheckoutLink"
      </code>
      
       | <code>
        "generateCustomerPortalUrl"
      </code>
      
       | <code>
        "listWorkspaces"
      </code>
      
       | <code>
        "listWorkspaceMembers"
      </code>
      
      , <code>
        string
      </code>
      
      >>
    </td>
    
    <td>
      Override the Convex functions the built-in tools call — needed only when the scaffolded <code>
        auth.ts
      </code>
      
      /<code>
        billing.ts
      </code>
      
       files were renamed. Values are <code>
        module:export
      </code>
      
       refs, e.g. <code>
        { getCredits: 'myBilling:getCredits' }
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/module.ts" rel="nofollow">
        src/module.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### ModuleOptions

Defined in: [src/module.ts](https://github.com/qruto/nuxt-backend/blob/main/src/module.ts)

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="url">
        
      </a>
      
       <code>
        url?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/module.ts" rel="nofollow">
        src/module.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="siteurl">
        
      </a>
      
       <code>
        siteUrl?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/module.ts" rel="nofollow">
        src/module.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="authroute">
        
      </a>
      
       <code>
        authRoute?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/module.ts" rel="nofollow">
        src/module.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="scaffold">
        
      </a>
      
       <code>
        scaffold?
      </code>
    </td>
    
    <td>
      <code>
        false
      </code>
      
       | <code>
        "auto"
      </code>
    </td>
    
    <td>
      Auto-scaffold missing Convex backend files on dev startup. Set <code>
        false
      </code>
      
       when you scaffold explicitly with <code>
        npx nuxt-backend init
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/module.ts" rel="nofollow">
        src/module.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="pages">
        
      </a>
      
       <code>
        pages?
      </code>
    </td>
    
    <td>
      <code>
        ModulePagesOptions
      </code>
    </td>
    
    <td>
      Where the ready-made pages mount (sign-in, pricing, settings, profile, security, the invitation and agent-consent pages). Every page is on; give a key a path to move it. To replace a page, put an app page at its path: an app page always wins over the module's.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/module.ts" rel="nofollow">
        src/module.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="autoenv">
        
      </a>
      
       <code>
        autoEnv?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      On dev startup, provision the <code>
        dev:
      </code>
      
       deployment env automatically — the same engine as <code>
        npx nuxt-backend env push
      </code>
      
      : forward <code>
        .env(.local)
      </code>
      
       values, generate <code>
        AUTH_SECRET
      </code>
      
      , default <code>
        SITE_URL
      </code>
      
       to localhost, and echo OTP codes to the convex dev console until an email transport exists. Runs once per deployment (stamped under <code>
        node_modules/.cache/nuxt-backend
      </code>
      
      ), asynchronously after startup. Never touches non-dev deployments. <code>
        false
      </code>
      
       to manage the deployment env yourself.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/module.ts" rel="nofollow">
        src/module.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="mcp">
        
      </a>
      
       <code>
        mcp?
      </code>
    </td>
    
    <td>
      <a href="#modulemcpoptions">
        <code>
          ModuleMcpOptions
        </code>
      </a>
    </td>
    
    <td>
      The agent (MCP) surface — an OAuth-protected <code>
        /mcp
      </code>
      
       endpoint with built-in account/billing/workspace tools. See <a href="#modulemcpoptions">
        ModuleMcpOptions
      </a>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/module.ts" rel="nofollow">
        src/module.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="devtools">
        
      </a>
      
       <code>
        devtools?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      The Backend tab in Nuxt DevTools (dev only): the deployment and its env names, live checks and doctor on demand, the signed-in account, billing, email, the webhook delivery log and the agent endpoint. Enabled by default whenever Nuxt DevTools is; set <code>
        false
      </code>
      
       to disable just the Backend tab.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/module.ts" rel="nofollow">
        src/module.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### BackendAuthService

Defined in: node_modules/nuxt-convex-module/runtime/better-auth/nuxt/server

Per-request Better Auth + Convex helper returned by [convexAuth](https://nuxt-convex-module.dev/api-reference/reference/better-auth/server).

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="gettoken">
        
      </a>
      
       <code>
        getToken
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        string
      </code>
      
       | <code>
        undefined
      </code>
      
      >
    </td>
    
    <td>
      Convex JWT for the current user, or <code>
        undefined
      </code>
      
       when not authenticated.
    </td>
    
    <td>
      node_modules/nuxt-convex-module/runtime/better-auth/nuxt/server
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="handler">
        
      </a>
      
       <code>
        handler
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        Response
      </code>
      
      >
    </td>
    
    <td>
      Proxy a Better Auth route to the configured Convex site URL.
    </td>
    
    <td>
      node_modules/nuxt-convex-module/runtime/better-auth/nuxt/server
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="isauthenticated">
        
      </a>
      
       <code>
        isAuthenticated
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        boolean
      </code>
      
      >
    </td>
    
    <td>
      <code>
        true
      </code>
      
       when the current request has a valid Convex auth token.
    </td>
    
    <td>
      node_modules/nuxt-convex-module/runtime/better-auth/nuxt/server
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="preloadauthquery">
        
      </a>
      
       <code>
        preloadAuthQuery
      </code>
    </td>
    
    <td>
      <<code>
        Query
      </code>
      
      >(<code>
        query
      </code>
      
      , ...<code>
        args
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        Preloaded
      </code>
      
      <<code>
        Query
      </code>
      
      >>
    </td>
    
    <td>
      Preload a Convex query with the current user's auth token.
    </td>
    
    <td>
      node_modules/nuxt-convex-module/runtime/better-auth/nuxt/server
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="fetchauthquery">
        
      </a>
      
       <code>
        fetchAuthQuery
      </code>
    </td>
    
    <td>
      <<code>
        Query
      </code>
      
      >(<code>
        query
      </code>
      
      , ...<code>
        args
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        FunctionReturnType
      </code>
      
      <<code>
        Query
      </code>
      
      >>
    </td>
    
    <td>
      Execute a Convex query with the current user's auth token.
    </td>
    
    <td>
      node_modules/nuxt-convex-module/runtime/better-auth/nuxt/server
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="fetchauthmutation">
        
      </a>
      
       <code>
        fetchAuthMutation
      </code>
    </td>
    
    <td>
      <<code>
        Mutation
      </code>
      
      >(<code>
        mutation
      </code>
      
      , ...<code>
        args
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        FunctionReturnType
      </code>
      
      <<code>
        Mutation
      </code>
      
      >>
    </td>
    
    <td>
      Execute a Convex mutation with the current user's auth token.
    </td>
    
    <td>
      node_modules/nuxt-convex-module/runtime/better-auth/nuxt/server
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="fetchauthaction">
        
      </a>
      
       <code>
        fetchAuthAction
      </code>
    </td>
    
    <td>
      <<code>
        Action
      </code>
      
      >(<code>
        action
      </code>
      
      , ...<code>
        args
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        FunctionReturnType
      </code>
      
      <<code>
        Action
      </code>
      
      >>
    </td>
    
    <td>
      Execute a Convex action with the current user's auth token.
    </td>
    
    <td>
      node_modules/nuxt-convex-module/runtime/better-auth/nuxt/server
    </td>
  </tr>
</tbody>
</table>

## Type Aliases

### BackendMcpFunctionKey

```ts
type BackendMcpFunctionKey = keyof typeof BACKEND_MCP_FUNCTION_DEFAULTS;
```

Defined in: [src/runtime/server/mcp/builtin.ts](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/server/mcp/builtin.ts)

---

### BackendMcpToolName

```ts
type BackendMcpToolName = 
  | "profile-get"
  | "profile-update"
  | "billing-plans"
  | "billing-subscription"
  | "credits-balance"
  | "billing-checkout-link"
  | "billing-portal-link"
  | "workspace-list"
  | "workspace-members";
```

Defined in: [src/runtime/server/mcp/builtin.ts](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/server/mcp/builtin.ts)

The built-in agent tools, by MCP tool name.

---

### BackendAuthOptions

```ts
type BackendAuthOptions = GetTokenOptions & {
  convexUrl?: string;
  convexSiteUrl?: string;
};
```

Defined in: node_modules/nuxt-convex-module/runtime/better-auth/nuxt/server

Options for [convexAuth](https://nuxt-convex-module.dev/api-reference/reference/better-auth/server).

Extends [GetTokenOptions](https://labs.convex.dev/better-auth) from `@convex-dev/better-auth/utils` with
an optional override for the Convex site URL.

#### Type Declaration

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        convexUrl?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Accepted for drop-in compatibility with upstream <code>
        convexBetterAuthNextJs
      </code>
      
       option objects and ignored — upstream requires but never reads it either; the deployment URL comes from runtime config.
    </td>
    
    <td>
      node_modules/nuxt-convex-module/runtime/better-auth/nuxt/server
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        convexSiteUrl?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Override the Convex site URL. Defaults to <code>
        runtimeConfig.convex.siteUrl
      </code>
      
      , then <code>
        runtimeConfig.public.convex.siteUrl
      </code>
      
      , then the <code>
        NUXT_PUBLIC_CONVEX_SITE_URL
      </code>
      
       process variable.
    </td>
    
    <td>
      node_modules/nuxt-convex-module/runtime/better-auth/nuxt/server
    </td>
  </tr>
</tbody>
</table>

## Variables

### default

```ts
default: NuxtModule<ModuleOptions, ModuleOptions, false>;
```

Defined in: [src/module.ts](https://github.com/qruto/nuxt-backend/blob/main/src/module.ts)


## Sitemap

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