Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: TanStack Router
description: "Learn about Sentry's TanStack Router integration."
---

_(Available in version 8.7.0 and above)_

TanStack Router support is included in the `@sentry/react` package since version `8.7.0` and is only compatible with version `1.34.5` of ` `@tanstack/router` and above.

<Alert level="info" title="Note">

The TanStack Router integration is designed to work with Sentry Performance Monitoring. Please see <PlatformLink to="/performance/#enable-tracing">Getting Started with React Performance</PlatformLink> for more details on how to set up and install the SDK.

</Alert>

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

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

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

const router = createRouter({
// Your router options...
});

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,
});
```

## Next Steps:

- [Return to **Getting Started**](../../)
- [Return to the main integrations page](../)