Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = require('@sentry/core'); const client = require('./client.js'); const flush = require('./flush.js'); const httpServer = require('./integrations/httpServer.js'); const fetch = require('./integrations/fetch.js'); const hono = require('./integrations/hono.js'); const spotlight = require('./integrations/spotlight.js'); const tracer = require('./opentelemetry/tracer.js'); const transport = require('./transport.js'); const stacktrace = require('./vendor/stacktrace.js'); function getRegisteredChannelIntegrations() { const registered = core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__?.integrations; return registered ? [...registered.values()].map((factory) => factory()) : []; } function getDefaultIntegrations(options) { const cookiesEnabled = options.sendDefaultPii || options.dataCollection?.cookies != null; return [ // The Dedupe integration should not be used in workflows because we want to // capture all step failures, even if they are the same error. ...options.enableDedupe === false ? [] : [core.dedupeIntegration()], // TODO(v11): Replace with `eventFiltersIntegration` once we remove the deprecated `inboundFiltersIntegration` // eslint-disable-next-line typescript/no-deprecated core.inboundFiltersIntegration(), core.functionToStringIntegration(), core.conversationIdIntegration(), core.linkedErrorsIntegration(), fetch.fetchIntegration(), // eslint-disable-next-line typescript/no-deprecated hono.honoIntegration(), httpServer.httpServerIntegration(), core.requestDataIntegration(cookiesEnabled ? void 0 : { include: { cookies: false } }), core.consoleIntegration(), // The orchestrion diagnostics-channel subscribers (mysql, pg, …). The // `@sentry/cloudflare/vite` plugin injects the channels at build time and, // next to each, a snippet that registers the matching subscriber factory on // the global marker. Read from there instead of importing them so bundles // built without the plugin — where the channels would never fire — don't // ship the code. ...getRegisteredChannelIntegrations() ]; } function init(options) { if (options.defaultIntegrations === void 0) { options.defaultIntegrations = getDefaultIntegrations(options); } const flushLock = options.ctx ? flush.makeFlushLock(options.ctx) : void 0; delete options.ctx; const clientOptions = { ...options, stackParser: core.stackParserFromStackParserOptions(options.stackParser || stacktrace.defaultStackParser), integrations: core.getIntegrationsToSetup(options), transport: options.transport || transport.makeCloudflareTransport, flushLock }; if (options.spotlight && !clientOptions.integrations.some(({ name }) => name === spotlight.INTEGRATION_NAME)) { clientOptions.integrations.push( spotlight.spotlightIntegration({ sidecarUrl: typeof options.spotlight === "string" ? options.spotlight : void 0 }) ); } if (!options.skipOpenTelemetrySetup) { tracer.setupOpenTelemetryTracer(); } return core.initAndBind(client.CloudflareClient, clientOptions); } exports.getDefaultIntegrations = getDefaultIntegrations; exports.init = init; //# sourceMappingURL=sdk.js.map