API Reference

Module Configuration

Reference for the public convex module key exposed by nuxt-convex.

Use the convex key in nuxt.config.ts to configure the Nuxt wrapper.

Configuration key

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-convex'],
  convex: {
    dir: 'convex',
    url: 'https://your-app.convex.cloud',
    server: true,
    storage: false,
    r2: false,
  },
})

Options

OptionTypeDefaultMeaning
dirstring'convex'Convex source directory. Relative paths are resolved across Nuxt layers.
urlstring''Convex deployment URL. Falls back to environment variables when omitted.
serverbooleantrueDefault SSR behavior for useConvexQuery.
storagebooleanfalseEnables #convex/storage, storage auto-imports, and scaffolding for convex/_hub/storage.ts.
r2booleanfalseEnables the useConvexR2Upload auto-import.

Environment resolution

When convex.url is not set explicitly, the module reads:

  1. CONVEX_URL
  2. NUXT_PUBLIC_CONVEX_URL

If no URL is resolved, the runtime starts disconnected and the module logs a warning in development.

Public Nuxt surface

The public Nuxt alias matrix is #convex, #convex/api, #convex/advanced, with optional #convex/storage when storage is enabled.

Always available:

  • #convex
  • #convex/api
  • #convex/advanced
  • auto-imports for the shared root composables
  • global ConvexQuery and ConvexPaginatedQuery
  • global ConvexAuthenticated, ConvexUnauthenticated, and ConvexAuthLoading

Available when storage: true:

  • #convex/storage
  • useConvexStorage
  • useConvexUpload

Available when r2: true:

  • useConvexR2Upload

The module does not create an R2-specific alias.

Runtime config

The module writes these values to runtimeConfig.public.convex:

  • dir
  • url
  • server
  • storage
  • r2
Copyright © 2026