Advanced

Module Configuration

Complete reference for all nuxt.config.ts convex options.

All options are set under the convex key in nuxt.config.ts:

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['better-convex-nuxt'],

  convex: {
    // Options go here
  },
})

Options Reference

Core

OptionTypeDefaultDescription
urlstringundefinedConvex deployment URL (e.g., https://your-app.convex.cloud). Usually set via CONVEX_URL env var.
siteUrlstringAuto-derivedConvex HTTP Actions URL (e.g., https://your-app.convex.site). Auto-derived from url by replacing .convex.cloud with .convex.site. Override for custom domains.

Authentication

OptionTypeDefaultDescription
authConvexAuthConfigInput{ enabled: true }Authentication config. Set auth.enabled = false to disable auth features. See Authentication.
authRoutestring'/api/auth'Route path for the auth proxy.
trustedOriginsstring[][]Additional trusted origins for CORS on the auth proxy. Supports wildcards (e.g., 'https://preview-*.vercel.app').
skipAuthRoutesstring[][]Routes that skip auth checks entirely. Supports globs (/docs/**). See Skipping Auth.

Auth Proxy Limits

OptionTypeDefaultDescription
authProxyAuthProxyOptions{}Request/response body-size limits for the Better Auth proxy route.
nuxt.config.ts
convex: {
  authProxy: {
    maxRequestBodyBytes: 1_048_576,  // 1 MiB
    maxResponseBodyBytes: 1_048_576, // 1 MiB
  },
}

Query Defaults

OptionTypeDefaultDescription
defaultsQueryDefaults{}Default options for useConvexQuery and useConvexPaginatedQuery. Per-query options override these.
nuxt.config.ts
convex: {
  defaults: {
    server: true,    // Run queries on server during SSR (default)
    subscribe: true, // Enable real-time subscriptions (default)
    auth: 'auto',    // Attach auth token when available (default)
  },
}

Upload

OptionTypeDefaultDescription
uploadUploadDefaults{}Default options for upload composables.
nuxt.config.ts
convex: {
  upload: {
    maxConcurrent: 3,  // Max concurrent uploads for useConvexUploadQueue
  },
}

Caching

OptionTypeDefaultDescription
authCacheAuthCacheOptions{ enabled: false, ttl: 60 }SSR auth token caching. See Performance.
nuxt.config.ts
convex: {
  authCache: {
    enabled: true,
    ttl: 60, // 60 seconds (max)
  },
}

Permissions

OptionTypeDefaultDescription
permissionsbooleanfalseEnable permission composables (createPermissions factory). See Permissions.

Logging & Debug

OptionTypeDefaultDescription
loggingfalse | 'info' | 'debug'falseModule log level. See Logging.
debugConvexDebugOptions{}Enable high-verbosity trace logs for specific channels.
nuxt.config.ts
convex: {
  logging: 'info',
  debug: {
    authFlow: false,        // Detailed auth flow logs (both client and server)
    clientAuthFlow: false,  // Client-only auth flow trace
    serverAuthFlow: false,  // Server-only auth flow trace
  },
}

Full Example

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['better-convex-nuxt'],

  convex: {
    url: process.env.CONVEX_URL,
    // siteUrl: 'https://custom-domain.example.com', // Only if using custom domain

    auth: { enabled: true },
    skipAuthRoutes: ['/', '/pricing', '/docs/**'],

    defaults: {
      server: true,
      subscribe: true,
    },

    upload: {
      maxConcurrent: 3,
    },

    authCache: {
      enabled: true,
      ttl: 60,
    },

    permissions: true,

    logging: process.env.NODE_ENV === 'development' ? 'debug' : false,
  },
})