-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathsdk.ts
More file actions
29 lines (24 loc) · 849 Bytes
/
sdk.ts
File metadata and controls
29 lines (24 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import type { Integration } from '@sentry/core';
import { applySdkMetadata } from '@sentry/core';
import type { NodeClient, NodeOptions } from '@sentry/node';
import { getDefaultIntegrations as getDefaultNodeIntegrations, init as nodeInit } from '@sentry/node';
/**
* Initializes the Nitro SDK
*/
export function init(options: NodeOptions | undefined = {}): NodeClient | undefined {
const opts: NodeOptions = {
defaultIntegrations: getDefaultIntegrations(options),
...options,
};
applySdkMetadata(opts, 'nitro');
const client = nodeInit(opts);
return client;
}
/**
* Get the default integrations for the Nitro SDK.
*
* @returns The default integrations for the Nitro SDK.
*/
export function getDefaultIntegrations(options: NodeOptions): Integration[] | undefined {
return [...getDefaultNodeIntegrations(options)];
}