-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathsdk.ts
More file actions
22 lines (19 loc) · 827 Bytes
/
sdk.ts
File metadata and controls
22 lines (19 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import type { Client } from '@sentry/core';
import { applySdkMetadata } from '@sentry/core';
import type { BrowserOptions as ReactBrowserOptions } from '@sentry/react';
import { getDefaultIntegrations as getReactDefaultIntegrations, init as initReactSDK } from '@sentry/react';
import { applyTunnelRouteOption } from './tunnelRoute';
/**
* Initializes the TanStack Start React SDK
*
* @param options Configuration options for the SDK.
*/
export function init(options: ReactBrowserOptions): Client | undefined {
const sentryOptions: ReactBrowserOptions = {
defaultIntegrations: [...getReactDefaultIntegrations(options)],
...options,
};
applyTunnelRouteOption(sentryOptions);
applySdkMetadata(sentryOptions, 'tanstackstart-react', ['tanstackstart-react', 'react']);
return initReactSDK(sentryOptions);
}