UNPKG

2.74 kBTypeScriptView Raw
1import { Integrations as CoreIntegrations } from '@sentry/core';
2import { NodeClient } from './client';
3import { Console, Http, LinkedErrors, OnUncaughtException, OnUnhandledRejection } from './integrations';
4import { NodeOptions } from './types';
5export declare const defaultIntegrations: (CoreIntegrations.FunctionToString | CoreIntegrations.InboundFilters | Console | Http | OnUncaughtException | OnUnhandledRejection | LinkedErrors)[];
6/**
7 * The Sentry Node SDK Client.
8 *
9 * To use this SDK, call the {@link init} function as early as possible in the
10 * main entry module. To set context information or send manual events, use the
11 * provided methods.
12 *
13 * @example
14 * ```
15 *
16 * const { init } = require('@sentry/node');
17 *
18 * init({
19 * dsn: '__DSN__',
20 * // ...
21 * });
22 * ```
23 *
24 * @example
25 * ```
26 *
27 * const { configureScope } = require('@sentry/node');
28 * configureScope((scope: Scope) => {
29 * scope.setExtra({ battery: 0.7 });
30 * scope.setTag({ user_mode: 'admin' });
31 * scope.setUser({ id: '4711' });
32 * });
33 * ```
34 *
35 * @example
36 * ```
37 *
38 * const { addBreadcrumb } = require('@sentry/node');
39 * addBreadcrumb({
40 * message: 'My Breadcrumb',
41 * // ...
42 * });
43 * ```
44 *
45 * @example
46 * ```
47 *
48 * const Sentry = require('@sentry/node');
49 * Sentry.captureMessage('Hello, world!');
50 * Sentry.captureException(new Error('Good bye'));
51 * Sentry.captureEvent({
52 * message: 'Manual',
53 * stacktrace: [
54 * // ...
55 * ],
56 * });
57 * ```
58 *
59 * @see {@link NodeOptions} for documentation on configuration options.
60 */
61export declare function init(options?: NodeOptions): void;
62/**
63 * This is the getter for lastEventId.
64 *
65 * @returns The last event id of a captured event.
66 */
67export declare function lastEventId(): string | undefined;
68/**
69 * A promise that resolves when all current events have been sent.
70 * If you provide a timeout and the queue takes longer to drain the promise returns false.
71 *
72 * @param timeout Maximum time in ms the client should wait.
73 */
74export declare function flush(timeout?: number): Promise<boolean>;
75/**
76 * A promise that resolves when all current events have been sent.
77 * If you provide a timeout and the queue takes longer to drain the promise returns false.
78 *
79 * @param timeout Maximum time in ms the client should wait.
80 */
81export declare function close(timeout?: number): Promise<boolean>;
82/**
83 * Function that takes an instance of NodeClient and checks if autoSessionTracking option is enabled for that client
84 */
85export declare function isAutoSessionTrackingEnabled(client?: NodeClient): boolean;
86/**
87 * Returns a release dynamically from environment variables.
88 */
89export declare function getSentryRelease(fallback?: string): string | undefined;
90//# sourceMappingURL=sdk.d.ts.map
\No newline at end of file