UNPKG

@sentry/node

Version:

Sentry Node SDK using OpenTelemetry for performance instrumentation

32 lines (31 loc) • 1.03 kB
import { makeServeTunnelIntegration } from "@sentry/server-utils"; // src/integrations/serveTunnel.ts /** * Lets your server forward the events of a browser SDK set up with `tunnel: true` to Sentry. * * With this integration on the server and `tunnel: true` in the browser `init`, the browser sends its events to your * own server instead of Sentry, where ad-blockers can't drop them, and your server forwards them to Sentry. * * Every `node:http` server answers the tunnel requests before the app sees them. To serve them from your own code * instead, set `intercept: false` and call `handleTunnelRequestIfMatched`. * * By default only envelopes for the server's own DSN are forwarded. * * @example * ```js * // Server * Sentry.init({ * dsn: '__DSN__', * integrations: [Sentry.serveTunnelIntegration()], * }); * * // Browser * Sentry.init({ * dsn: '__DSN__', * tunnel: true, * }); * ``` */ const serveTunnelIntegration = makeServeTunnelIntegration(); export { serveTunnelIntegration }; //# sourceMappingURL=serveTunnel.js.map