@sentry/tanstackstart-react 9.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +52 -0
  3. package/build/cjs/client/index.js +17 -0
  4. package/build/cjs/client/index.js.map +1 -0
  5. package/build/cjs/common/index.js +30 -0
  6. package/build/cjs/common/index.js.map +1 -0
  7. package/build/cjs/config/index.js +18 -0
  8. package/build/cjs/config/index.js.map +1 -0
  9. package/build/cjs/index.client.js +21 -0
  10. package/build/cjs/index.client.js.map +1 -0
  11. package/build/cjs/index.server.js +28 -0
  12. package/build/cjs/index.server.js.map +1 -0
  13. package/build/cjs/server/index.js +60 -0
  14. package/build/cjs/server/index.js.map +1 -0
  15. package/build/esm/client/index.js +2 -0
  16. package/build/esm/client/index.js.map +1 -0
  17. package/build/esm/common/index.js +26 -0
  18. package/build/esm/common/index.js.map +1 -0
  19. package/build/esm/config/index.js +16 -0
  20. package/build/esm/config/index.js.map +1 -0
  21. package/build/esm/index.client.js +3 -0
  22. package/build/esm/index.client.js.map +1 -0
  23. package/build/esm/index.server.js +5 -0
  24. package/build/esm/index.server.js.map +1 -0
  25. package/build/esm/package.json +1 -0
  26. package/build/esm/server/index.js +45 -0
  27. package/build/esm/server/index.js.map +1 -0
  28. package/build/import-hook.mjs +1 -0
  29. package/build/loader-hook.mjs +1 -0
  30. package/build/types/client/index.d.ts +2 -0
  31. package/build/types/client/index.d.ts.map +1 -0
  32. package/build/types/common/index.d.ts +15 -0
  33. package/build/types/common/index.d.ts.map +1 -0
  34. package/build/types/config/index.d.ts +10 -0
  35. package/build/types/config/index.d.ts.map +1 -0
  36. package/build/types/index.client.d.ts +3 -0
  37. package/build/types/index.client.d.ts.map +1 -0
  38. package/build/types/index.server.d.ts +4 -0
  39. package/build/types/index.server.d.ts.map +1 -0
  40. package/build/types/index.types.d.ts +19 -0
  41. package/build/types/index.types.d.ts.map +1 -0
  42. package/build/types/server/index.d.ts +21 -0
  43. package/build/types/server/index.d.ts.map +1 -0
  44. package/build/types-ts3.8/client/index.d.ts +2 -0
  45. package/build/types-ts3.8/common/index.d.ts +15 -0
  46. package/build/types-ts3.8/config/index.d.ts +10 -0
  47. package/build/types-ts3.8/index.client.d.ts +3 -0
  48. package/build/types-ts3.8/index.server.d.ts +4 -0
  49. package/build/types-ts3.8/index.types.d.ts +19 -0
  50. package/build/types-ts3.8/server/index.d.ts +21 -0
  51. package/package.json +86 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Functional Software, Inc. dba Sentry
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,52 @@
1
+ <p align="center">
2
+ <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
3
+ <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
4
+ </a>
5
+ </p>
6
+
7
+ # Official Sentry SDK for TanStack Start React (Alpha)
8
+
9
+ [![npm version](https://img.shields.io/npm/v/@sentry/tanstackstart-react.svg)](https://www.npmjs.com/package/@sentry/tanstackstart-react)
10
+ [![npm dm](https://img.shields.io/npm/dm/@sentry/tanstackstart-react.svg)](https://www.npmjs.com/package/@sentry/tanstackstart-react)
11
+ [![npm dt](https://img.shields.io/npm/dt/@sentry/tanstackstart-react.svg)](https://www.npmjs.com/package/@sentry/tanstackstart-react)
12
+
13
+ > NOTICE: This package is in alpha state and may be subject to breaking changes.
14
+
15
+ ## Getting Started
16
+
17
+ This SDK does not have docs yet. Stay tuned.
18
+
19
+ ## Compatibility
20
+
21
+ The minimum supported version of TanStack Start is `1.111.12`.
22
+
23
+ ## Custom Usage
24
+
25
+ To set context information or to send manual events, you can use `@sentry/tanstackstart-react` as follows:
26
+
27
+ ```ts
28
+ import * as Sentry from '@sentry/tanstackstart-react';
29
+
30
+ // Set user information, as well as tags and further extras
31
+ Sentry.setTag('user_mode', 'admin');
32
+ Sentry.setUser({ id: '4711' });
33
+ Sentry.setContext('application_area', { location: 'checkout' });
34
+
35
+ // Add a breadcrumb for future events
36
+ Sentry.addBreadcrumb({
37
+ message: '"Add to cart" clicked',
38
+ // ...
39
+ });
40
+
41
+ // Capture exceptions or messages
42
+ Sentry.captureException(new Error('Oh no.'));
43
+ Sentry.captureMessage('Hello, world!');
44
+ ```
45
+
46
+ ## Links
47
+
48
+ <!-- - [Official SDK Docs](https://docs.sentry.io/platforms/javascript/guides/tanstackstart-react/) -->
49
+
50
+ - [Sentry.io](https://sentry.io/?utm_source=github&utm_medium=npm_tanstackstartreact)
51
+ - [Sentry Discord Server](https://discord.gg/Ww9hbqr)
52
+ - [Stack Overflow](https://stackoverflow.com/questions/tagged/sentry)
@@ -0,0 +1,17 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const react = require('@sentry/react');
4
+
5
+
6
+
7
+ Object.prototype.hasOwnProperty.call(react, '__proto__') &&
8
+ !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
9
+ Object.defineProperty(exports, '__proto__', {
10
+ enumerable: true,
11
+ value: react['__proto__']
12
+ });
13
+
14
+ Object.keys(react).forEach(k => {
15
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = react[k];
16
+ });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -0,0 +1,30 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ /**
4
+ * A middleware handler that can be passed to TanStack Start's `createMiddleware().server(...)` method as [global middleware](https://tanstack.com/start/latest/docs/framework/react/middleware#global-middleware) for instrumenting server functions.
5
+ */
6
+ function sentryGlobalServerMiddlewareHandler() {
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
+ return function (server) {
9
+ return server.next();
10
+ };
11
+ }
12
+
13
+ /**
14
+ * Wraps a TanStack Start stream handler with Sentry instrumentation that can be passed to `createStartHandler(...)`.
15
+ */
16
+ function wrapStreamHandlerWithSentry(handler) {
17
+ return handler;
18
+ }
19
+
20
+ /**
21
+ * Wraps the create root route function with Sentry for server-client tracing with SSR.
22
+ */
23
+ function wrapCreateRootRouteWithSentry(createRootRoute) {
24
+ return createRootRoute;
25
+ }
26
+
27
+ exports.sentryGlobalServerMiddlewareHandler = sentryGlobalServerMiddlewareHandler;
28
+ exports.wrapCreateRootRouteWithSentry = wrapCreateRootRouteWithSentry;
29
+ exports.wrapStreamHandlerWithSentry = wrapStreamHandlerWithSentry;
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/common/index.ts"],"sourcesContent":["/**\n * A middleware handler that can be passed to TanStack Start's `createMiddleware().server(...)` method as [global middleware](https://tanstack.com/start/latest/docs/framework/react/middleware#global-middleware) for instrumenting server functions.\n */\nexport function sentryGlobalServerMiddlewareHandler() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function <T>(server: { next: (...args: any[]) => T }): T {\n return server.next();\n };\n}\n\n/**\n * Wraps a TanStack Start stream handler with Sentry instrumentation that can be passed to `createStartHandler(...)`.\n */\nexport function wrapStreamHandlerWithSentry<H>(handler: H): H {\n return handler;\n}\n\n/**\n * Wraps the create root route function with Sentry for server-client tracing with SSR.\n */\nexport function wrapCreateRootRouteWithSentry<F>(createRootRoute: F): F {\n return createRootRoute;\n}\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACO,SAAS,mCAAmC,GAAG;AACtD;AACA,EAAE,OAAO,UAAa,MAAM,EAAsC;AAClE,IAAI,OAAO,MAAM,CAAC,IAAI,EAAE;AACxB,GAAG;AACH;;AAEA;AACA;AACA;AACO,SAAS,2BAA2B,CAAI,OAAO,EAAQ;AAC9D,EAAE,OAAO,OAAO;AAChB;;AAEA;AACA;AACA;AACO,SAAS,6BAA6B,CAAI,eAAe,EAAQ;AACxE,EAAE,OAAO,eAAe;AACxB;;;;;;"}
@@ -0,0 +1,18 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ /**
4
+ * Wraps a TanStack Start config.
5
+ */
6
+ function wrapVinxiConfigWithSentry(
7
+ config,
8
+ // TODO: Expand this type in the future. Right now it is just so that TS doesn't complain for our users when they copy paste from the docs.
9
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
+ sentryBuildOptions
11
+
12
+ = {},
13
+ ) {
14
+ return config;
15
+ }
16
+
17
+ exports.wrapVinxiConfigWithSentry = wrapVinxiConfigWithSentry;
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/config/index.ts"],"sourcesContent":["/**\n * Wraps a TanStack Start config.\n */\nexport function wrapVinxiConfigWithSentry<C>(\n config: C,\n // TODO: Expand this type in the future. Right now it is just so that TS doesn't complain for our users when they copy paste from the docs.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n sentryBuildOptions: {\n org?: string;\n project?: string;\n silent?: boolean;\n authToken?: boolean;\n } = {},\n): C {\n return config;\n}\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACO,SAAS,yBAAyB;AACzC,EAAE,MAAM;AACR;AACA;AACA,EAAE;;AAKA,GAAI,EAAE;AACR,EAAK;AACL,EAAE,OAAO,MAAM;AACf;;;;"}
@@ -0,0 +1,21 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const react = require('@sentry/react');
4
+ const index = require('./common/index.js');
5
+
6
+
7
+
8
+ exports.sentryGlobalServerMiddlewareHandler = index.sentryGlobalServerMiddlewareHandler;
9
+ exports.wrapCreateRootRouteWithSentry = index.wrapCreateRootRouteWithSentry;
10
+ exports.wrapStreamHandlerWithSentry = index.wrapStreamHandlerWithSentry;
11
+ Object.prototype.hasOwnProperty.call(react, '__proto__') &&
12
+ !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
13
+ Object.defineProperty(exports, '__proto__', {
14
+ enumerable: true,
15
+ value: react['__proto__']
16
+ });
17
+
18
+ Object.keys(react).forEach(k => {
19
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = react[k];
20
+ });
21
+ //# sourceMappingURL=index.client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,28 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const index = require('./config/index.js');
4
+ const index$1 = require('./server/index.js');
5
+ const index$2 = require('./common/index.js');
6
+ const node = require('@sentry/node');
7
+
8
+
9
+
10
+ exports.wrapVinxiConfigWithSentry = index.wrapVinxiConfigWithSentry;
11
+ exports.ErrorBoundary = index$1.ErrorBoundary;
12
+ exports.createReduxEnhancer = index$1.createReduxEnhancer;
13
+ exports.showReportDialog = index$1.showReportDialog;
14
+ exports.withErrorBoundary = index$1.withErrorBoundary;
15
+ exports.sentryGlobalServerMiddlewareHandler = index$2.sentryGlobalServerMiddlewareHandler;
16
+ exports.wrapCreateRootRouteWithSentry = index$2.wrapCreateRootRouteWithSentry;
17
+ exports.wrapStreamHandlerWithSentry = index$2.wrapStreamHandlerWithSentry;
18
+ Object.prototype.hasOwnProperty.call(node, '__proto__') &&
19
+ !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
20
+ Object.defineProperty(exports, '__proto__', {
21
+ enumerable: true,
22
+ value: node['__proto__']
23
+ });
24
+
25
+ Object.keys(node).forEach(k => {
26
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = node[k];
27
+ });
28
+ //# sourceMappingURL=index.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.server.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,60 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const node = require('@sentry/node');
4
+
5
+ /**
6
+ * A passthrough error boundary for the server that doesn't depend on any react. Error boundaries don't catch SSR errors
7
+ * so they should simply be a passthrough.
8
+ */
9
+ const ErrorBoundary = (props) => {
10
+ if (!props.children) {
11
+ return null;
12
+ }
13
+
14
+ if (typeof props.children === 'function') {
15
+ return (props.children )();
16
+ }
17
+
18
+ return props.children;
19
+ };
20
+
21
+ /**
22
+ * A passthrough redux enhancer for the server that doesn't depend on anything from the `@sentry/react` package.
23
+ */
24
+ function createReduxEnhancer() {
25
+ return (createStore) => createStore;
26
+ }
27
+
28
+ /**
29
+ * A passthrough error boundary wrapper for the server that doesn't depend on any react. Error boundaries don't catch
30
+ * SSR errors so they should simply be a passthrough.
31
+ */
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ function withErrorBoundary(
34
+ WrappedComponent,
35
+ ) {
36
+ return WrappedComponent ;
37
+ }
38
+
39
+ /**
40
+ * Just a passthrough since we're on the server and showing the report dialog on the server doesn't make any sense.
41
+ */
42
+ function showReportDialog() {
43
+ return;
44
+ }
45
+
46
+ exports.ErrorBoundary = ErrorBoundary;
47
+ exports.createReduxEnhancer = createReduxEnhancer;
48
+ exports.showReportDialog = showReportDialog;
49
+ exports.withErrorBoundary = withErrorBoundary;
50
+ Object.prototype.hasOwnProperty.call(node, '__proto__') &&
51
+ !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
52
+ Object.defineProperty(exports, '__proto__', {
53
+ enumerable: true,
54
+ value: node['__proto__']
55
+ });
56
+
57
+ Object.keys(node).forEach(k => {
58
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = node[k];
59
+ });
60
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/server/index.ts"],"sourcesContent":["export * from '@sentry/node';\n\n/**\n * A passthrough error boundary for the server that doesn't depend on any react. Error boundaries don't catch SSR errors\n * so they should simply be a passthrough.\n */\nexport const ErrorBoundary = (props: React.PropsWithChildren<unknown>): React.ReactNode => {\n if (!props.children) {\n return null;\n }\n\n if (typeof props.children === 'function') {\n return (props.children as () => React.ReactNode)();\n }\n\n return props.children;\n};\n\n/**\n * A passthrough redux enhancer for the server that doesn't depend on anything from the `@sentry/react` package.\n */\nexport function createReduxEnhancer() {\n return (createStore: unknown) => createStore;\n}\n\n/**\n * A passthrough error boundary wrapper for the server that doesn't depend on any react. Error boundaries don't catch\n * SSR errors so they should simply be a passthrough.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function withErrorBoundary<P extends Record<string, any>>(\n WrappedComponent: React.ComponentType<P>,\n): React.FC<P> {\n return WrappedComponent as React.FC<P>;\n}\n\n/**\n * Just a passthrough since we're on the server and showing the report dialog on the server doesn't make any sense.\n */\nexport function showReportDialog(): void {\n return;\n}\n"],"names":[],"mappings":";;;;AAEA;AACA;AACA;AACA;AACa,MAAA,aAAA,GAAgB,CAAC,KAAK,KAAwD;AAC3F,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;AACvB,IAAI,OAAO,IAAI;AACf;;AAEA,EAAE,IAAI,OAAO,KAAK,CAAC,QAAS,KAAI,UAAU,EAAE;AAC5C,IAAI,OAAO,CAAC,KAAK,CAAC,QAAS,IAA2B;AACtD;;AAEA,EAAE,OAAO,KAAK,CAAC,QAAQ;AACvB;;AAEA;AACA;AACA;AACO,SAAS,mBAAmB,GAAG;AACtC,EAAE,OAAO,CAAC,WAAW,KAAc,WAAW;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB;AACjC,EAAE,gBAAgB;AAClB,EAAe;AACf,EAAE,OAAO,gBAAiB;AAC1B;;AAEA;AACA;AACA;AACO,SAAS,gBAAgB,GAAS;AACzC,EAAE;AACF;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ export * from '@sentry/react';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * A middleware handler that can be passed to TanStack Start's `createMiddleware().server(...)` method as [global middleware](https://tanstack.com/start/latest/docs/framework/react/middleware#global-middleware) for instrumenting server functions.
3
+ */
4
+ function sentryGlobalServerMiddlewareHandler() {
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ return function (server) {
7
+ return server.next();
8
+ };
9
+ }
10
+
11
+ /**
12
+ * Wraps a TanStack Start stream handler with Sentry instrumentation that can be passed to `createStartHandler(...)`.
13
+ */
14
+ function wrapStreamHandlerWithSentry(handler) {
15
+ return handler;
16
+ }
17
+
18
+ /**
19
+ * Wraps the create root route function with Sentry for server-client tracing with SSR.
20
+ */
21
+ function wrapCreateRootRouteWithSentry(createRootRoute) {
22
+ return createRootRoute;
23
+ }
24
+
25
+ export { sentryGlobalServerMiddlewareHandler, wrapCreateRootRouteWithSentry, wrapStreamHandlerWithSentry };
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/common/index.ts"],"sourcesContent":["/**\n * A middleware handler that can be passed to TanStack Start's `createMiddleware().server(...)` method as [global middleware](https://tanstack.com/start/latest/docs/framework/react/middleware#global-middleware) for instrumenting server functions.\n */\nexport function sentryGlobalServerMiddlewareHandler() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function <T>(server: { next: (...args: any[]) => T }): T {\n return server.next();\n };\n}\n\n/**\n * Wraps a TanStack Start stream handler with Sentry instrumentation that can be passed to `createStartHandler(...)`.\n */\nexport function wrapStreamHandlerWithSentry<H>(handler: H): H {\n return handler;\n}\n\n/**\n * Wraps the create root route function with Sentry for server-client tracing with SSR.\n */\nexport function wrapCreateRootRouteWithSentry<F>(createRootRoute: F): F {\n return createRootRoute;\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACO,SAAS,mCAAmC,GAAG;AACtD;AACA,EAAE,OAAO,UAAa,MAAM,EAAsC;AAClE,IAAI,OAAO,MAAM,CAAC,IAAI,EAAE;AACxB,GAAG;AACH;;AAEA;AACA;AACA;AACO,SAAS,2BAA2B,CAAI,OAAO,EAAQ;AAC9D,EAAE,OAAO,OAAO;AAChB;;AAEA;AACA;AACA;AACO,SAAS,6BAA6B,CAAI,eAAe,EAAQ;AACxE,EAAE,OAAO,eAAe;AACxB;;;;"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Wraps a TanStack Start config.
3
+ */
4
+ function wrapVinxiConfigWithSentry(
5
+ config,
6
+ // TODO: Expand this type in the future. Right now it is just so that TS doesn't complain for our users when they copy paste from the docs.
7
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
8
+ sentryBuildOptions
9
+
10
+ = {},
11
+ ) {
12
+ return config;
13
+ }
14
+
15
+ export { wrapVinxiConfigWithSentry };
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/config/index.ts"],"sourcesContent":["/**\n * Wraps a TanStack Start config.\n */\nexport function wrapVinxiConfigWithSentry<C>(\n config: C,\n // TODO: Expand this type in the future. Right now it is just so that TS doesn't complain for our users when they copy paste from the docs.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n sentryBuildOptions: {\n org?: string;\n project?: string;\n silent?: boolean;\n authToken?: boolean;\n } = {},\n): C {\n return config;\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACO,SAAS,yBAAyB;AACzC,EAAE,MAAM;AACR;AACA;AACA,EAAE;;AAKA,GAAI,EAAE;AACR,EAAK;AACL,EAAE,OAAO,MAAM;AACf;;;;"}
@@ -0,0 +1,3 @@
1
+ export * from '@sentry/react';
2
+ export { sentryGlobalServerMiddlewareHandler, wrapCreateRootRouteWithSentry, wrapStreamHandlerWithSentry } from './common/index.js';
3
+ //# sourceMappingURL=index.client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,5 @@
1
+ export { wrapVinxiConfigWithSentry } from './config/index.js';
2
+ export { ErrorBoundary, createReduxEnhancer, showReportDialog, withErrorBoundary } from './server/index.js';
3
+ export { sentryGlobalServerMiddlewareHandler, wrapCreateRootRouteWithSentry, wrapStreamHandlerWithSentry } from './common/index.js';
4
+ export * from '@sentry/node';
5
+ //# sourceMappingURL=index.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.server.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1 @@
1
+ {"type":"module","version":"9.6.0","sideEffects":false}
@@ -0,0 +1,45 @@
1
+ export * from '@sentry/node';
2
+
3
+ /**
4
+ * A passthrough error boundary for the server that doesn't depend on any react. Error boundaries don't catch SSR errors
5
+ * so they should simply be a passthrough.
6
+ */
7
+ const ErrorBoundary = (props) => {
8
+ if (!props.children) {
9
+ return null;
10
+ }
11
+
12
+ if (typeof props.children === 'function') {
13
+ return (props.children )();
14
+ }
15
+
16
+ return props.children;
17
+ };
18
+
19
+ /**
20
+ * A passthrough redux enhancer for the server that doesn't depend on anything from the `@sentry/react` package.
21
+ */
22
+ function createReduxEnhancer() {
23
+ return (createStore) => createStore;
24
+ }
25
+
26
+ /**
27
+ * A passthrough error boundary wrapper for the server that doesn't depend on any react. Error boundaries don't catch
28
+ * SSR errors so they should simply be a passthrough.
29
+ */
30
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
+ function withErrorBoundary(
32
+ WrappedComponent,
33
+ ) {
34
+ return WrappedComponent ;
35
+ }
36
+
37
+ /**
38
+ * Just a passthrough since we're on the server and showing the report dialog on the server doesn't make any sense.
39
+ */
40
+ function showReportDialog() {
41
+ return;
42
+ }
43
+
44
+ export { ErrorBoundary, createReduxEnhancer, showReportDialog, withErrorBoundary };
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/server/index.ts"],"sourcesContent":["export * from '@sentry/node';\n\n/**\n * A passthrough error boundary for the server that doesn't depend on any react. Error boundaries don't catch SSR errors\n * so they should simply be a passthrough.\n */\nexport const ErrorBoundary = (props: React.PropsWithChildren<unknown>): React.ReactNode => {\n if (!props.children) {\n return null;\n }\n\n if (typeof props.children === 'function') {\n return (props.children as () => React.ReactNode)();\n }\n\n return props.children;\n};\n\n/**\n * A passthrough redux enhancer for the server that doesn't depend on anything from the `@sentry/react` package.\n */\nexport function createReduxEnhancer() {\n return (createStore: unknown) => createStore;\n}\n\n/**\n * A passthrough error boundary wrapper for the server that doesn't depend on any react. Error boundaries don't catch\n * SSR errors so they should simply be a passthrough.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function withErrorBoundary<P extends Record<string, any>>(\n WrappedComponent: React.ComponentType<P>,\n): React.FC<P> {\n return WrappedComponent as React.FC<P>;\n}\n\n/**\n * Just a passthrough since we're on the server and showing the report dialog on the server doesn't make any sense.\n */\nexport function showReportDialog(): void {\n return;\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACa,MAAA,aAAA,GAAgB,CAAC,KAAK,KAAwD;AAC3F,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;AACvB,IAAI,OAAO,IAAI;AACf;;AAEA,EAAE,IAAI,OAAO,KAAK,CAAC,QAAS,KAAI,UAAU,EAAE;AAC5C,IAAI,OAAO,CAAC,KAAK,CAAC,QAAS,IAA2B;AACtD;;AAEA,EAAE,OAAO,KAAK,CAAC,QAAQ;AACvB;;AAEA;AACA;AACA;AACO,SAAS,mBAAmB,GAAG;AACtC,EAAE,OAAO,CAAC,WAAW,KAAc,WAAW;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB;AACjC,EAAE,gBAAgB;AAClB,EAAe;AACf,EAAE,OAAO,gBAAiB;AAC1B;;AAEA;AACA;AACA;AACO,SAAS,gBAAgB,GAAS;AACzC,EAAE;AACF;;;;"}
@@ -0,0 +1 @@
1
+ export { getFormat, getSource, load, resolve } from '@sentry/node/loader-hook';
@@ -0,0 +1 @@
1
+ import '@sentry/node/import-hook';
@@ -0,0 +1,2 @@
1
+ export * from '@sentry/react';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * A middleware handler that can be passed to TanStack Start's `createMiddleware().server(...)` method as [global middleware](https://tanstack.com/start/latest/docs/framework/react/middleware#global-middleware) for instrumenting server functions.
3
+ */
4
+ export declare function sentryGlobalServerMiddlewareHandler(): <T>(server: {
5
+ next: (...args: any[]) => T;
6
+ }) => T;
7
+ /**
8
+ * Wraps a TanStack Start stream handler with Sentry instrumentation that can be passed to `createStartHandler(...)`.
9
+ */
10
+ export declare function wrapStreamHandlerWithSentry<H>(handler: H): H;
11
+ /**
12
+ * Wraps the create root route function with Sentry for server-client tracing with SSR.
13
+ */
14
+ export declare function wrapCreateRootRouteWithSentry<F>(createRootRoute: F): F;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,mCAAmC;oBAEH,GAAG,EAAE;QAGpD;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAE5D;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,GAAG,CAAC,CAEtE"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Wraps a TanStack Start config.
3
+ */
4
+ export declare function wrapVinxiConfigWithSentry<C>(config: C, sentryBuildOptions?: {
5
+ org?: string;
6
+ project?: string;
7
+ silent?: boolean;
8
+ authToken?: boolean;
9
+ }): C;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,MAAM,EAAE,CAAC,EAGT,kBAAkB,GAAE;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CAChB,GACL,CAAC,CAEH"}
@@ -0,0 +1,3 @@
1
+ export * from './client';
2
+ export * from './common';
3
+ //# sourceMappingURL=index.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../src/index.client.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './config';
2
+ export * from './server';
3
+ export * from './common';
4
+ //# sourceMappingURL=index.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../../src/index.server.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,19 @@
1
+ export * from './config';
2
+ export * from './client';
3
+ export * from './server';
4
+ export * from './common';
5
+ import type { Client, Integration, Options, StackParser } from '@sentry/core';
6
+ import type * as clientSdk from './client';
7
+ import type * as serverSdk from './server';
8
+ /** Initializes Sentry TanStack Start SDK */
9
+ export declare function init(options: Options | clientSdk.BrowserOptions | serverSdk.NodeOptions): Client | undefined;
10
+ export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
11
+ export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
12
+ export declare const getDefaultIntegrations: (options: Options) => Integration[];
13
+ export declare const defaultStackParser: StackParser;
14
+ export declare function getSentryRelease(fallback?: string): string | undefined;
15
+ export declare const ErrorBoundary: typeof clientSdk.ErrorBoundary;
16
+ export declare const createReduxEnhancer: typeof clientSdk.createReduxEnhancer;
17
+ export declare const showReportDialog: typeof clientSdk.showReportDialog;
18
+ export declare const withErrorBoundary: typeof clientSdk.withErrorBoundary;
19
+ //# sourceMappingURL=index.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.types.d.ts","sourceRoot":"","sources":["../../src/index.types.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE9E,OAAO,KAAK,KAAK,SAAS,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,KAAK,SAAS,MAAM,UAAU,CAAC;AAE3C,4CAA4C;AAC5C,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC,cAAc,GAAG,SAAS,CAAC,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AAEtH,MAAM,CAAC,OAAO,CAAC,MAAM,uBAAuB,EAAE,OAAO,SAAS,CAAC,uBAAuB,CAAC;AACvF,MAAM,CAAC,OAAO,CAAC,MAAM,uBAAuB,EAAE,OAAO,SAAS,CAAC,uBAAuB,CAAC;AAEvF,MAAM,CAAC,OAAO,CAAC,MAAM,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,WAAW,EAAE,CAAC;AACjF,MAAM,CAAC,OAAO,CAAC,MAAM,kBAAkB,EAAE,WAAW,CAAC;AAErD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhF,MAAM,CAAC,OAAO,CAAC,MAAM,aAAa,EAAE,OAAO,SAAS,CAAC,aAAa,CAAC;AACnE,MAAM,CAAC,OAAO,CAAC,MAAM,mBAAmB,EAAE,OAAO,SAAS,CAAC,mBAAmB,CAAC;AAC/E,MAAM,CAAC,OAAO,CAAC,MAAM,gBAAgB,EAAE,OAAO,SAAS,CAAC,gBAAgB,CAAC;AACzE,MAAM,CAAC,OAAO,CAAC,MAAM,iBAAiB,EAAE,OAAO,SAAS,CAAC,iBAAiB,CAAC"}
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ export * from '@sentry/node';
3
+ /**
4
+ * A passthrough error boundary for the server that doesn't depend on any react. Error boundaries don't catch SSR errors
5
+ * so they should simply be a passthrough.
6
+ */
7
+ export declare const ErrorBoundary: (props: React.PropsWithChildren<unknown>) => React.ReactNode;
8
+ /**
9
+ * A passthrough redux enhancer for the server that doesn't depend on anything from the `@sentry/react` package.
10
+ */
11
+ export declare function createReduxEnhancer(): (createStore: unknown) => unknown;
12
+ /**
13
+ * A passthrough error boundary wrapper for the server that doesn't depend on any react. Error boundaries don't catch
14
+ * SSR errors so they should simply be a passthrough.
15
+ */
16
+ export declare function withErrorBoundary<P extends Record<string, any>>(WrappedComponent: React.ComponentType<P>): React.FC<P>;
17
+ /**
18
+ * Just a passthrough since we're on the server and showing the report dialog on the server doesn't make any sense.
19
+ */
20
+ export declare function showReportDialog(): void;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":";AAAA,cAAc,cAAc,CAAC;AAE7B;;;GAGG;AACH,eAAO,MAAM,aAAa,UAAW,MAAM,iBAAiB,CAAC,OAAO,CAAC,KAAG,MAAM,SAU7E,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,kBACZ,OAAO,aAC7B;AAED;;;GAGG;AAEH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7D,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GACvC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAEb;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}
@@ -0,0 +1,2 @@
1
+ export * from '@sentry/react';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * A middleware handler that can be passed to TanStack Start's `createMiddleware().server(...)` method as [global middleware](https://tanstack.com/start/latest/docs/framework/react/middleware#global-middleware) for instrumenting server functions.
3
+ */
4
+ export declare function sentryGlobalServerMiddlewareHandler(): <T>(server: {
5
+ next: (...args: any[]) => T;
6
+ }) => T;
7
+ /**
8
+ * Wraps a TanStack Start stream handler with Sentry instrumentation that can be passed to `createStartHandler(...)`.
9
+ */
10
+ export declare function wrapStreamHandlerWithSentry<H>(handler: H): H;
11
+ /**
12
+ * Wraps the create root route function with Sentry for server-client tracing with SSR.
13
+ */
14
+ export declare function wrapCreateRootRouteWithSentry<F>(createRootRoute: F): F;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Wraps a TanStack Start config.
3
+ */
4
+ export declare function wrapVinxiConfigWithSentry<C>(config: C, sentryBuildOptions?: {
5
+ org?: string;
6
+ project?: string;
7
+ silent?: boolean;
8
+ authToken?: boolean;
9
+ }): C;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './client';
2
+ export * from './common';
3
+ //# sourceMappingURL=index.client.d.ts.map
@@ -0,0 +1,4 @@
1
+ export * from './config';
2
+ export * from './server';
3
+ export * from './common';
4
+ //# sourceMappingURL=index.server.d.ts.map
@@ -0,0 +1,19 @@
1
+ export * from './config';
2
+ export * from './client';
3
+ export * from './server';
4
+ export * from './common';
5
+ import { Client, Integration, Options, StackParser } from '@sentry/core';
6
+ import * as clientSdk from './client';
7
+ import * as serverSdk from './server';
8
+ /** Initializes Sentry TanStack Start SDK */
9
+ export declare function init(options: Options | clientSdk.BrowserOptions | serverSdk.NodeOptions): Client | undefined;
10
+ export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
11
+ export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
12
+ export declare const getDefaultIntegrations: (options: Options) => Integration[];
13
+ export declare const defaultStackParser: StackParser;
14
+ export declare function getSentryRelease(fallback?: string): string | undefined;
15
+ export declare const ErrorBoundary: typeof clientSdk.ErrorBoundary;
16
+ export declare const createReduxEnhancer: typeof clientSdk.createReduxEnhancer;
17
+ export declare const showReportDialog: typeof clientSdk.showReportDialog;
18
+ export declare const withErrorBoundary: typeof clientSdk.withErrorBoundary;
19
+ //# sourceMappingURL=index.types.d.ts.map
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ export * from '@sentry/node';
3
+ /**
4
+ * A passthrough error boundary for the server that doesn't depend on any react. Error boundaries don't catch SSR errors
5
+ * so they should simply be a passthrough.
6
+ */
7
+ export declare const ErrorBoundary: (props: React.PropsWithChildren<unknown>) => React.ReactNode;
8
+ /**
9
+ * A passthrough redux enhancer for the server that doesn't depend on anything from the `@sentry/react` package.
10
+ */
11
+ export declare function createReduxEnhancer(): (createStore: unknown) => unknown;
12
+ /**
13
+ * A passthrough error boundary wrapper for the server that doesn't depend on any react. Error boundaries don't catch
14
+ * SSR errors so they should simply be a passthrough.
15
+ */
16
+ export declare function withErrorBoundary<P extends Record<string, any>>(WrappedComponent: React.ComponentType<P>): React.FC<P>;
17
+ /**
18
+ * Just a passthrough since we're on the server and showing the report dialog on the server doesn't make any sense.
19
+ */
20
+ export declare function showReportDialog(): void;
21
+ //# sourceMappingURL=index.d.ts.map
package/package.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "name": "@sentry/tanstackstart-react",
3
+ "version": "9.6.0",
4
+ "description": "Official Sentry SDK for TanStack Start React",
5
+ "repository": "git://github.com/getsentry/sentry-javascript.git",
6
+ "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/tanstackstart-react",
7
+ "author": "Sentry",
8
+ "license": "MIT",
9
+ "engines": {
10
+ "node": ">=18"
11
+ },
12
+ "main": "build/cjs/index.server.js",
13
+ "module": "build/esm/index.server.js",
14
+ "types": "build/types/index.types.d.ts",
15
+ "files": [
16
+ "/build"
17
+ ],
18
+ "exports": {
19
+ "./package.json": "./package.json",
20
+ ".": {
21
+ "types": "./build/types/index.types.d.ts",
22
+ "browser": {
23
+ "import": "./build/esm/index.client.js",
24
+ "require": "./build/cjs/index.client.js"
25
+ },
26
+ "node": {
27
+ "import": "./build/esm/index.server.js",
28
+ "require": "./build/cjs/index.server.js"
29
+ }
30
+ },
31
+ "./import": {
32
+ "import": {
33
+ "default": "./build/import-hook.mjs"
34
+ }
35
+ },
36
+ "./loader": {
37
+ "import": {
38
+ "default": "./build/loader-hook.mjs"
39
+ }
40
+ }
41
+ },
42
+ "typesVersions": {
43
+ "<5.0": {
44
+ "build/npm/types/index.d.ts": [
45
+ "build/npm/types-ts3.8/index.d.ts"
46
+ ]
47
+ }
48
+ },
49
+ "publishConfig": {
50
+ "access": "public"
51
+ },
52
+ "dependencies": {
53
+ "@opentelemetry/api": "^1.9.0",
54
+ "@opentelemetry/semantic-conventions": "^1.30.0",
55
+ "@sentry-internal/browser-utils": "9.6.0",
56
+ "@sentry/core": "9.6.0",
57
+ "@sentry/node": "9.6.0",
58
+ "@sentry/opentelemetry": "9.6.0",
59
+ "@sentry/react": "9.6.0"
60
+ },
61
+ "scripts": {
62
+ "build": "run-p build:transpile build:types",
63
+ "build:dev": "yarn build",
64
+ "build:transpile": "rollup -c rollup.npm.config.mjs",
65
+ "build:types": "run-s build:types:core build:types:downlevel",
66
+ "build:types:core": "tsc -p tsconfig.types.json",
67
+ "build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
68
+ "build:watch": "run-p build:transpile:watch build:types:watch",
69
+ "build:dev:watch": "yarn build:watch",
70
+ "build:transpile:watch": "nodemon --ext ts --watch src scripts/buildRollup.ts",
71
+ "build:types:watch": "tsc -p tsconfig.types.json --watch",
72
+ "build:tarball": "npm pack",
73
+ "circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts",
74
+ "clean": "rimraf build coverage sentry-tanstackstart-react-*.tgz",
75
+ "fix": "eslint . --format stylish --fix",
76
+ "lint": "eslint . --format stylish",
77
+ "test": "yarn test:unit",
78
+ "test:unit": "vitest run",
79
+ "test:watch": "vitest --watch",
80
+ "yalc:publish": "yalc publish --push --sig"
81
+ },
82
+ "volta": {
83
+ "extends": "../../package.json"
84
+ },
85
+ "sideEffects": false
86
+ }