UNPKG

@sentry/remix

Version:
47 lines (36 loc) • 1.44 kB
Object.defineProperty(exports, '__esModule', { value: true }); const node = require('@sentry/node'); const utils = require('@sentry/utils'); const instrumentServer = require('./utils/instrumentServer.js'); const metadata = require('./utils/metadata.js'); const react = require('@sentry/react'); const client = require('./performance/client.js'); const express = require('./utils/serverAdapters/express.js'); /* eslint-disable import/export */ function sdkAlreadyInitialized() { const hub = node.getCurrentHub(); return !!hub.getClient(); } /** Initializes Sentry Remix SDK on Node. */ function init(options) { metadata.buildMetadata(options, ['remix', 'node']); if (sdkAlreadyInitialized()) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('SDK already initialized'); return; } instrumentServer.instrumentServer(); node.init(options); node.configureScope(scope => { scope.setTag('runtime', 'node'); }); } exports.ErrorBoundary = react.ErrorBoundary; exports.withErrorBoundary = react.withErrorBoundary; exports.remixRouterInstrumentation = client.remixRouterInstrumentation; exports.withSentry = client.withSentry; exports.wrapExpressCreateRequestHandler = express.wrapExpressCreateRequestHandler; exports.init = init; for (const k in node) { if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = node[k]; } //# sourceMappingURL=index.server.js.map