@sentry/node
Version:
Offical Sentry SDK for Node.js
39 lines • 1.4 kB
JavaScript
import * as tslib_1 from "tslib";
import { BaseClient } from '@sentry/core';
import { NodeBackend } from './backend';
import { SDK_NAME, SDK_VERSION } from './version';
/**
* The Sentry Node SDK Client.
*
* @see NodeOptions for documentation on configuration options.
* @see SentryClient for usage documentation.
*/
var NodeClient = /** @class */ (function (_super) {
tslib_1.__extends(NodeClient, _super);
/**
* Creates a new Node SDK instance.
* @param options Configuration options for this SDK.
*/
function NodeClient(options) {
return _super.call(this, NodeBackend, options) || this;
}
/**
* @inheritDoc
*/
NodeClient.prototype._prepareEvent = function (event, scope, hint) {
event.platform = event.platform || 'node';
event.sdk = tslib_1.__assign({}, event.sdk, { name: SDK_NAME, packages: tslib_1.__spread(((event.sdk && event.sdk.packages) || []), [
{
name: 'npm:@sentry/node',
version: SDK_VERSION,
},
]), version: SDK_VERSION });
if (this.getOptions().serverName) {
event.server_name = this.getOptions().serverName;
}
return _super.prototype._prepareEvent.call(this, event, scope, hint);
};
return NodeClient;
}(BaseClient));
export { NodeClient };
//# sourceMappingURL=client.js.map