UNPKG

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