---
title: "Limited Server Tracing"
description: "Learn how to set up the Nuxt SDK with limited server tracing by adding a top-level import to the build output."
url: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/limited-server-tracing/
---

# Limited Server Tracing | Sentry for Nuxt

## [Understanding Limited Server Tracing](https://docs.sentry.io/platforms/javascript/guides/nuxt/install/limited-server-tracing.md#understanding-limited-server-tracing)

Sentry needs to be initialized before the rest of the application runs. If the default way of adding an [`--import` CLI flag](https://docs.sentry.io/platforms/javascript/guides/nuxt/install/cli-import.md) doesn't work for you, enable the SDK to add a top-level `import`.

The automatically added top-level `import` will then import the Sentry server-side config at the top of the Nuxt server entry file. In this case, Sentry isn’t initialized before the app starts, but is set up as early as possible.

##### Restrictions of this installation method

This installation method has the fundamental restriction that only native Node.js APIs can be instrumented (such as `fetch` and the `http` module). As a result, the Sentry SDK will not capture data from database calls, queues, ORMs, third-party libraries, or other framework-specific data.

We recommend using this only if the `--import` flag is not an option for you.

## [Initializing Sentry With a Top-level `import`](https://docs.sentry.io/platforms/javascript/guides/nuxt/install/limited-server-tracing.md#initializing-sentry-with-a-top-level-import)

Enable the top-level `import` by setting `autoInjectServerSentry`:

`nuxt.config.ts`

```typescript
export default defineNuxtConfig({
  sentry: {

    autoInjectServerSentry: "top-level-import",

  },
});
```

By default, the SDK will add the Sentry server config to the build output (typically, `.output/server/sentry.server.config.mjs`). The SDK will then automatically import this file at the top of the Nitro server entry file in the build output.
