Files
klz-cables.com/.pnpm-store/v10/files/f2/246d8d89090adf9e2809a7b0f9406baedef29e0fc53e1e8cdb7cc86b09736d0a5139d3d7bebdd19b7b7faff038e0522250602e6c3390a0748dff532eba5136
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

47 lines
1.8 KiB
Plaintext

import { defineIntegration, debug, startSession, captureSession } from '@sentry/core';
import { addHistoryInstrumentationHandler } from '@sentry-internal/browser-utils';
import { DEBUG_BUILD } from '../debug-build.js';
import { WINDOW } from '../helpers.js';
/**
* When added, automatically creates sessions which allow you to track adoption and crashes (crash free rate) in your Releases in Sentry.
* More information: https://docs.sentry.io/product/releases/health/
*
* Note: In order for session tracking to work, you need to set up Releases: https://docs.sentry.io/product/releases/
*/
const browserSessionIntegration = defineIntegration((options = {}) => {
const lifecycle = options.lifecycle ?? 'route';
return {
name: 'BrowserSession',
setupOnce() {
if (typeof WINDOW.document === 'undefined') {
DEBUG_BUILD &&
debug.warn('Using the `browserSessionIntegration` in non-browser environments is not supported.');
return;
}
// The session duration for browser sessions does not track a meaningful
// concept that can be used as a metric.
// Automatically captured sessions are akin to page views, and thus we
// discard their duration.
startSession({ ignoreDuration: true });
captureSession();
if (lifecycle === 'route') {
// We want to create a session for every navigation as well
addHistoryInstrumentationHandler(({ from, to }) => {
// Don't create an additional session for the initial route or if the location did not change
if (from !== undefined && from !== to) {
startSession({ ignoreDuration: true });
captureSession();
}
});
}
},
};
});
export { browserSessionIntegration };
//# sourceMappingURL=browsersession.js.map