---
title: "Virtual Modules"
description: "Reference for the Nuxt-only aliases created by nuxt-convex."
canonical_url: "https://nuxt-convex.onmax.me/api-reference/virtual-modules"
---
# Virtual Modules

> Reference for the Nuxt-only aliases created by nuxt-convex.

`nuxt-convex` creates aliases so app code imports the public runtime without reaching into generated or build directories.

## Always available

<table>
<thead>
  <tr>
    <th>
      Import
    </th>
    
    <th>
      Where
    </th>
    
    <th>
      What it exposes
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        #convex
      </code>
    </td>
    
    <td>
      app
    </td>
    
    <td>
      The root composables, <code>
        isConvexError
      </code>
      
      , the auth components and the pagination helpers
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        #convex/advanced
      </code>
    </td>
    
    <td>
      app
    </td>
    
    <td>
      The controller and the raw client helpers
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        #convex/api
      </code>
    </td>
    
    <td>
      app and server
    </td>
    
    <td>
      The generated Convex <code>
        api
      </code>
      
      , <code>
        internal
      </code>
      
       and <code>
        components
      </code>
      
       exports
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        #convex/server
      </code>
    </td>
    
    <td>
      server only
    </td>
    
    <td>
      The Nitro helpers: <code>
        useConvexServer
      </code>
      
      , <code>
        serverConvexQuery
      </code>
      
      , <code>
        serverConvexMutation
      </code>
      
      , <code>
        serverConvexAction
      </code>
      
      , <code>
        getConvexToken
      </code>
      
      , <code>
        requireConvexAuth
      </code>
      
      , <code>
        toConvexH3Error
      </code>
      
      , and their types
    </td>
  </tr>
</tbody>
</table>

## Available when `storage: true`

<table>
<thead>
  <tr>
    <th>
      Import
    </th>
    
    <th>
      What it exposes
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        #convex/storage
      </code>
    </td>
    
    <td>
      The storage helpers from <code>
        vue-convex/storage
      </code>
    </td>
  </tr>
</tbody>
</table>

## Available when `r2: true`

There is no R2-specific virtual module. Enabling `r2: true` only adds the `useConvexR2Upload` auto-import.

## Examples

```vue [app/pages/tasks.vue]
<script setup lang="ts">
import { api } from '#convex/api'

const { data } = await useConvexQuery(api.tasks.list)
</script>
```

```ts [app/utils/errors.ts]
import { isConvexError } from '#convex'

export const isNotFound = (error: unknown) => isConvexError(error, 'NOT_FOUND')
```

```ts [server/api/stats.get.ts]
import { api } from '#convex/api'
import { serverConvexQuery } from '#convex/server'

export default defineEventHandler(event => serverConvexQuery(event, api.tasks.stats))
```

## Related pages

- [Module Configuration](https://nuxt-convex.onmax.me/api-reference/module-configuration)
- [Server Routes](https://nuxt-convex.onmax.me/nuxt-module/server-routes)
- [Nuxt Module](https://nuxt-convex.onmax.me/nuxt-module)


## Sitemap

See the full [sitemap](https://nuxt-convex.onmax.me/sitemap.md) for all pages.
