Skip to content
Source
Sign inSign up
TanStack/cli
Open History to see the last commit

client.tsx.ejs

33 lines1.2 KB

1import { hydrateRoot } from 'react-dom/client'
2import { StartClient } from '@tanstack/react-start'
3<% if (addOnEnabled.sentry) { %>
4import * as Sentry from "@sentry/tanstackstart-react";
5<% } %>
6import { createRouter } from './router'
7​
8const router = createRouter()
9​
10<% if (addOnEnabled.sentry) { %>
11 Sentry.init({
12 dsn: import.meta.env.VITE_SENTRY_DSN,
13 integrations: [
14 Sentry.tanstackRouterBrowserTracingIntegration(router),
15 Sentry.replayIntegration({
16 maskAllText: false,
17 blockAllMedia: false,
18 }),
19 ],
20 // Set tracesSampleRate to 1.0 to capture 100%
21 // of transactions for tracing.
22 // We recommend adjusting this value in production.
23 // Learn more at https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
24 tracesSampleRate: 1.0,
25 // Capture Replay for 10% of all sessions,
26 // plus for 100% of sessions with an error.
27 // Learn more at https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration
28 replaysSessionSampleRate: 0.1,
29 replaysOnErrorSampleRate: 1.0,
30 });
31<% } %>
32​
33hydrateRoot(document, <StartClient router={router} />)