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
| Option | Type | Default | Meaning |
|---|---|---|---|
dir | string | 'convex' | Convex source directory. Relative paths are resolved across Nuxt layers. |
url | string | '' | Convex deployment URL. Falls back to environment variables when omitted. |
server | boolean | true | Default SSR behavior for useConvexQuery. |
storage | boolean | false | Enables #convex/storage, storage auto-imports, and scaffolding for convex/_hub/storage.ts. |
r2 | boolean | false | Enables the useConvexR2Upload auto-import. |
Environment resolution
When convex.url is not set explicitly, the module reads:
CONVEX_URLNUXT_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
ConvexQueryandConvexPaginatedQuery - global
ConvexAuthenticated,ConvexUnauthenticated, andConvexAuthLoading
Available when storage: true:
#convex/storageuseConvexStorageuseConvexUpload
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:
dirurlserverstorager2