UNPKG

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