---
title: "TanStack Router"
description: "Learn about Sentry's TanStack Router integration."
url: https://docs.sentry.io/platforms/javascript/guides/tanstackstart-react/features/tanstack-router/
---

# TanStack Router | Sentry for TanStack Start React

The TanStack Router integration is included in the `@sentry/tanstackstart-react` package and is compatible with version `1.64.0` of `@tanstack/react-router` and above.

##### Note

The TanStack Router integration is designed to work with Sentry Tracing. Please see [Getting Started with TanStack Start React Performance](https://docs.sentry.io/platforms/javascript/guides/tanstackstart-react/tracing.md#enable-tracing) for more details on how to set up and install the SDK.

The TanStack Router instrumentation uses your TanStack Router routes to create `pageload/navigation` transactions to ensure you collect meaningful performance data about the health of your page loads and associated requests.

## [Usage](https://docs.sentry.io/platforms/javascript/guides/tanstackstart-react/features/tanstack-router.md#usage)

To use the TanStack Router integration, pass the `Sentry.tanstackRouterBrowserTracingIntegration` inside your `integrations` option:

`src/router.tsx`

```tsx
import * as Sentry from "@sentry/tanstackstart-react";
import { createRouter } from "@tanstack/react-router";

// Create a new router instance
export const getRouter = () => {
  const router = createRouter();

  if (!router.isServer) {
    Sentry.init({
      dsn: "___PUBLIC_DSN___",
      integrations: [Sentry.tanstackRouterBrowserTracingIntegration(router)],

      // Setting a sample rate is required for sending performance data.
      // We recommend adjusting this value in production, or using tracesSampler
      // for finer control.
      tracesSampleRate: 1.0,
    });
  }

  return router;
};
```

## [Next Steps:](https://docs.sentry.io/platforms/javascript/guides/tanstackstart-react/features/tanstack-router.md#next-steps)

* [Return to **Getting Started**](https://docs.sentry.io/platforms/javascript/guides/tanstackstart-react.md)
* [Return to the main integrations page](https://docs.sentry.io/platforms/javascript/guides/tanstackstart-react/features.md)
