Getting Started

Installation

Install and configure Nuxt Convex in your project.

Add Nuxt Convex to your project with the required peer dependencies.

Setup

Install the module and Convex:

pnpm add nuxt-convex convex
nuxt-convex ships with the recommended Vue integration (convex-vue), so you do not need to install it separately.

Add the module to your Nuxt configuration:

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-convex'],
  convex: {
    storage: true, // Enable file storage (optional)
  },
})

Environment Variables

The module reads CONVEX_URL or NUXT_PUBLIC_CONVEX_URL automatically.

Running npx convex dev starts the Convex development server and sets CONVEX_URL automatically.
VariableDescription
CONVEX_URLConvex deployment URL (set by npx convex dev)
NUXT_PUBLIC_CONVEX_URLAlternative, follows Nuxt convention

Virtual Modules

The module provides three virtual imports:

ImportPurpose
#convexCore composables and client
#convex/apiGenerated Convex API types
#convex/storageStorage operations (when enabled)
import { useConvexQuery } from '#convex'
import { api } from '#convex/api'

Next Steps

With the module installed, you can: