---
title: "Import aliases"
description: "The #backend aliases that point at your Convex functions directory and its generated files."
canonical_url: "https://nuxt-backend.dev/docs/reference/nuxt/import-aliases"
---
# Import aliases

> The #backend aliases that point at your Convex functions directory and its generated files.

The module registers `#backend` import aliases for both **Vite** and **Nitro**, pointing at your Convex functions directory (`backend/` or `convex/`) and its [generated files](https://docs.convex.dev/generated-api/).

```ts
import { api, internal, components } from '#backend/api'
import { query, mutation, action } from '#backend/server'
import type { Doc, Id } from '#backend/dataModel'
```

<table>
<thead>
  <tr>
    <th>
      Alias
    </th>
    
    <th>
      Resolves to
    </th>
    
    <th>
      Exports
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        #backend
      </code>
    </td>
    
    <td>
      your Convex functions dir (<code>
        backend/
      </code>
      
       or <code>
        convex/
      </code>
      
      )
    </td>
    
    <td>
      —
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        #backend/api
      </code>
    </td>
    
    <td>
      <code>
        _generated/api
      </code>
    </td>
    
    <td>
      <code>
        api
      </code>
      
      , <code>
        internal
      </code>
      
      , <code>
        components
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        #backend/server
      </code>
    </td>
    
    <td>
      <code>
        _generated/server
      </code>
    </td>
    
    <td>
      <code>
        query
      </code>
      
      , <code>
        mutation
      </code>
      
      , <code>
        action
      </code>
      
      , <code>
        *Ctx
      </code>
      
      , …
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        #backend/dataModel
      </code>
    </td>
    
    <td>
      <code>
        _generated/dataModel
      </code>
    </td>
    
    <td>
      <code>
        DataModel
      </code>
      
      , <code>
        Doc
      </code>
      
      , <code>
        Id
      </code>
      
      , <code>
        TableNames
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        #backend/_generated
      </code>
    </td>
    
    <td>
      <code>
        _generated
      </code>
      
       (long form)
    </td>
    
    <td>
      any generated file
    </td>
  </tr>
</tbody>
</table>

The short aliases resolve to the same files as `#backend/_generated/*`, so use whichever you prefer.

<warning>

Because `#backend/api`, `#backend/server`, and `#backend/dataModel` map straight to the generated modules, they **shadow** any function file you happen to name `api.ts` / `server.ts` / `dataModel.ts`. Import those via a different name (or `#backend/_generated/...`).

</warning>


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
