UNPKG

1.4 kBJavaScriptView Raw
1import * as tslib_1 from "tslib";
2import { BaseClient } from '@sentry/core';
3import { NodeBackend } from './backend';
4import { SDK_NAME, SDK_VERSION } from './version';
5/**
6 * The Sentry Node SDK Client.
7 *
8 * @see NodeOptions for documentation on configuration options.
9 * @see SentryClient for usage documentation.
10 */
11var NodeClient = /** @class */ (function (_super) {
12 tslib_1.__extends(NodeClient, _super);
13 /**
14 * Creates a new Node SDK instance.
15 * @param options Configuration options for this SDK.
16 */
17 function NodeClient(options) {
18 return _super.call(this, NodeBackend, options) || this;
19 }
20 /**
21 * @inheritDoc
22 */
23 NodeClient.prototype._prepareEvent = function (event, scope, hint) {
24 event.platform = event.platform || 'node';
25 event.sdk = tslib_1.__assign({}, event.sdk, { name: SDK_NAME, packages: tslib_1.__spread(((event.sdk && event.sdk.packages) || []), [
26 {
27 name: 'npm:@sentry/node',
28 version: SDK_VERSION,
29 },
30 ]), version: SDK_VERSION });
31 if (this.getOptions().serverName) {
32 event.server_name = this.getOptions().serverName;
33 }
34 return _super.prototype._prepareEvent.call(this, event, scope, hint);
35 };
36 return NodeClient;
37}(BaseClient));
38export { NodeClient };
39//# sourceMappingURL=client.js.map
\No newline at end of file