Skip to content

Commit 833cb56

Browse files
docs(solid): adds TanStack Router Solid docs page (#15054)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR This PR is the documentation complement to getsentry/sentry-javascript#17735 which adds support for TanStack Router Solid within Sentry. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [x] Low: I can wait a week but I would love for this to be merged and the `@sentry/solid` package to be updated + published as soon as possible as I am building an enterprise application using Sentry + TanStack Router Solid ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) --------- Co-authored-by: Andrei <168741329+andreiborza@users.noreply.github.com>
1 parent 81bda80 commit 833cb56

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: TanStack Router
3+
description: "Learn about Sentry's TanStack Router integration."
4+
---
5+
6+
The TanStack Router integration is included in the `@sentry/solid` package and is compatible with version `1.132.27` of `@tanstack/solid-router` and above.
7+
8+
<Alert title="Note">
9+
10+
The TanStack Router integration is designed to work with Sentry Tracing. Please see <PlatformLink to="/tracing/#enable-tracing">Getting Started with Solid Performance</PlatformLink> for more details on how to set up and install the SDK.
11+
12+
</Alert>
13+
14+
The TanStack Router instrumentation uses your TanStack Router routes to create `pageload` and `navigation` transactions to ensure you collect meaningful performance data about the health of your page loads and associated requests.
15+
16+
## Usage
17+
18+
To use the TanStack Router integration, pass the `Sentry.tanstackRouterBrowserTracingIntegration` inside your `integrations` option:
19+
20+
```javascript
21+
import * as Sentry from "@sentry/solid";
22+
import { tanstackRouterBrowserTracingIntegration } from '@sentry/solid/tanstackrouter';
23+
import { createRouter } from "@tanstack/solid-router";
24+
25+
const router = createRouter({
26+
// Your router options...
27+
});
28+
29+
declare module '@tanstack/solid-router' {
30+
interface Register {
31+
router: typeof router;
32+
}
33+
}
34+
35+
Sentry.init({
36+
dsn: "___PUBLIC_DSN___",
37+
integrations: [tanstackRouterBrowserTracingIntegration(router)],
38+
39+
// Setting a sample rate is required for sending performance data.
40+
// We recommend adjusting this value in production, or using tracesSampler
41+
// for finer control.
42+
tracesSampleRate: 1.0,
43+
});
44+
```
45+
46+
## Next Steps:
47+
48+
- [Return to **Getting Started**](../../)
49+
- [Return to the main integrations page](../)

0 commit comments

Comments
 (0)