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

# Limited Server Tracing for SolidStart

This installation method applies to SolidStart 1. On SolidStart 2, the Sentry Vite plugin instruments your dependencies at build time, so no preload is needed. See the [SolidStart guide](https://docs.sentry.io/platforms/javascript/guides/solidstart.md).

## [Understanding Limited Server Tracing](https://docs.sentry.io/platforms/javascript/guides/solidstart/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/solidstart/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 SolidStart 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/solidstart/install/limited-server-tracing.md#initializing-sentry-with-a-top-level-import)

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

```typescript
import { defineConfig } from "@solidjs/start/config";
import { withSentry } from "@sentry/solidstart";

export default defineConfig(
  withSentry(
    {},
    {
      autoInjectServerSentry: "top-level-import",
    },
  ),
);
```

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