@sentry/browser 10.53.0 → 10.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/build/npm/cjs/dev/client.js +15 -54
  2. package/build/npm/cjs/dev/client.js.map +1 -1
  3. package/build/npm/cjs/dev/debug-build.js +0 -5
  4. package/build/npm/cjs/dev/debug-build.js.map +1 -1
  5. package/build/npm/cjs/dev/diagnose-sdk.js +15 -37
  6. package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -1
  7. package/build/npm/cjs/dev/eventbuilder.js +59 -217
  8. package/build/npm/cjs/dev/eventbuilder.js.map +1 -1
  9. package/build/npm/cjs/dev/feedbackAsync.js +1 -5
  10. package/build/npm/cjs/dev/feedbackAsync.js.map +1 -1
  11. package/build/npm/cjs/dev/feedbackSync.js +1 -2
  12. package/build/npm/cjs/dev/feedbackSync.js.map +1 -1
  13. package/build/npm/cjs/dev/helpers.js +24 -102
  14. package/build/npm/cjs/dev/helpers.js.map +1 -1
  15. package/build/npm/cjs/dev/index.js +2 -0
  16. package/build/npm/cjs/dev/index.js.map +1 -1
  17. package/build/npm/cjs/dev/integrations/breadcrumbs.js +52 -134
  18. package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -1
  19. package/build/npm/cjs/dev/integrations/browserapierrors.js +45 -111
  20. package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -1
  21. package/build/npm/cjs/dev/integrations/browsersession.js +7 -35
  22. package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -1
  23. package/build/npm/cjs/dev/integrations/contextlines.js +9 -45
  24. package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -1
  25. package/build/npm/cjs/dev/integrations/culturecontext.js +11 -36
  26. package/build/npm/cjs/dev/integrations/culturecontext.js.map +1 -1
  27. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js +1 -22
  28. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
  29. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js +6 -31
  30. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  31. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js +6 -12
  32. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
  33. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js +5 -30
  34. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
  35. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js +10 -47
  36. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
  37. package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js +60 -0
  38. package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js.map +1 -0
  39. package/build/npm/cjs/dev/integrations/globalhandlers.js +38 -99
  40. package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -1
  41. package/build/npm/cjs/dev/integrations/graphqlClient.js +31 -119
  42. package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -1
  43. package/build/npm/cjs/dev/integrations/httpclient.js +43 -203
  44. package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -1
  45. package/build/npm/cjs/dev/integrations/httpcontext.js +7 -17
  46. package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -1
  47. package/build/npm/cjs/dev/integrations/linkederrors.js +7 -15
  48. package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -1
  49. package/build/npm/cjs/dev/integrations/reportingobserver.js +19 -44
  50. package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -1
  51. package/build/npm/cjs/dev/integrations/spanstreaming.js +11 -29
  52. package/build/npm/cjs/dev/integrations/spanstreaming.js.map +1 -1
  53. package/build/npm/cjs/dev/integrations/spotlight.js +17 -30
  54. package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -1
  55. package/build/npm/cjs/dev/integrations/view-hierarchy.js +19 -46
  56. package/build/npm/cjs/dev/integrations/view-hierarchy.js.map +1 -1
  57. package/build/npm/cjs/dev/integrations/webWorker.js +40 -211
  58. package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -1
  59. package/build/npm/cjs/dev/profiling/UIProfiler.js +87 -190
  60. package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -1
  61. package/build/npm/cjs/dev/profiling/index.js +9 -30
  62. package/build/npm/cjs/dev/profiling/index.js.map +1 -1
  63. package/build/npm/cjs/dev/profiling/integration.js +30 -64
  64. package/build/npm/cjs/dev/profiling/integration.js.map +1 -1
  65. package/build/npm/cjs/dev/profiling/startProfileForSpan.js +28 -84
  66. package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -1
  67. package/build/npm/cjs/dev/profiling/utils.js +131 -398
  68. package/build/npm/cjs/dev/profiling/utils.js.map +1 -1
  69. package/build/npm/cjs/dev/report-dialog.js +10 -25
  70. package/build/npm/cjs/dev/report-dialog.js.map +1 -1
  71. package/build/npm/cjs/dev/sdk.js +8 -76
  72. package/build/npm/cjs/dev/sdk.js.map +1 -1
  73. package/build/npm/cjs/dev/stack-parsers.js +42 -126
  74. package/build/npm/cjs/dev/stack-parsers.js.map +1 -1
  75. package/build/npm/cjs/dev/tracing/backgroundtab.js +4 -16
  76. package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -1
  77. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +102 -291
  78. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -1
  79. package/build/npm/cjs/dev/tracing/linkedTraces.js +25 -116
  80. package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -1
  81. package/build/npm/cjs/dev/tracing/reportPageLoaded.js +1 -9
  82. package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -1
  83. package/build/npm/cjs/dev/tracing/request.js +58 -223
  84. package/build/npm/cjs/dev/tracing/request.js.map +1 -1
  85. package/build/npm/cjs/dev/tracing/setActiveSpan.js +1 -48
  86. package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -1
  87. package/build/npm/cjs/dev/tracing/utils.js +4 -27
  88. package/build/npm/cjs/dev/tracing/utils.js.map +1 -1
  89. package/build/npm/cjs/dev/transports/fetch.js +10 -23
  90. package/build/npm/cjs/dev/transports/fetch.js.map +1 -1
  91. package/build/npm/cjs/dev/transports/offline.js +27 -84
  92. package/build/npm/cjs/dev/transports/offline.js.map +1 -1
  93. package/build/npm/cjs/dev/userfeedback.js +12 -22
  94. package/build/npm/cjs/dev/userfeedback.js.map +1 -1
  95. package/build/npm/cjs/dev/utils/detectBrowserExtension.js +5 -26
  96. package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -1
  97. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js +40 -75
  98. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -1
  99. package/build/npm/cjs/prod/client.js +15 -54
  100. package/build/npm/cjs/prod/client.js.map +1 -1
  101. package/build/npm/cjs/prod/debug-build.js +0 -5
  102. package/build/npm/cjs/prod/debug-build.js.map +1 -1
  103. package/build/npm/cjs/prod/diagnose-sdk.js +15 -37
  104. package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -1
  105. package/build/npm/cjs/prod/eventbuilder.js +59 -217
  106. package/build/npm/cjs/prod/eventbuilder.js.map +1 -1
  107. package/build/npm/cjs/prod/feedbackAsync.js +1 -5
  108. package/build/npm/cjs/prod/feedbackAsync.js.map +1 -1
  109. package/build/npm/cjs/prod/feedbackSync.js +1 -2
  110. package/build/npm/cjs/prod/feedbackSync.js.map +1 -1
  111. package/build/npm/cjs/prod/helpers.js +24 -102
  112. package/build/npm/cjs/prod/helpers.js.map +1 -1
  113. package/build/npm/cjs/prod/index.js +2 -0
  114. package/build/npm/cjs/prod/index.js.map +1 -1
  115. package/build/npm/cjs/prod/integrations/breadcrumbs.js +52 -134
  116. package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -1
  117. package/build/npm/cjs/prod/integrations/browserapierrors.js +45 -111
  118. package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -1
  119. package/build/npm/cjs/prod/integrations/browsersession.js +7 -35
  120. package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -1
  121. package/build/npm/cjs/prod/integrations/contextlines.js +9 -45
  122. package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -1
  123. package/build/npm/cjs/prod/integrations/culturecontext.js +11 -36
  124. package/build/npm/cjs/prod/integrations/culturecontext.js.map +1 -1
  125. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +1 -22
  126. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
  127. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +6 -31
  128. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  129. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +6 -12
  130. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
  131. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +5 -30
  132. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
  133. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +10 -47
  134. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
  135. package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js +60 -0
  136. package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js.map +1 -0
  137. package/build/npm/cjs/prod/integrations/globalhandlers.js +38 -99
  138. package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -1
  139. package/build/npm/cjs/prod/integrations/graphqlClient.js +31 -119
  140. package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -1
  141. package/build/npm/cjs/prod/integrations/httpclient.js +43 -203
  142. package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -1
  143. package/build/npm/cjs/prod/integrations/httpcontext.js +7 -17
  144. package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -1
  145. package/build/npm/cjs/prod/integrations/linkederrors.js +7 -15
  146. package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -1
  147. package/build/npm/cjs/prod/integrations/reportingobserver.js +19 -44
  148. package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -1
  149. package/build/npm/cjs/prod/integrations/spanstreaming.js +11 -29
  150. package/build/npm/cjs/prod/integrations/spanstreaming.js.map +1 -1
  151. package/build/npm/cjs/prod/integrations/spotlight.js +17 -30
  152. package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -1
  153. package/build/npm/cjs/prod/integrations/view-hierarchy.js +19 -46
  154. package/build/npm/cjs/prod/integrations/view-hierarchy.js.map +1 -1
  155. package/build/npm/cjs/prod/integrations/webWorker.js +40 -211
  156. package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -1
  157. package/build/npm/cjs/prod/profiling/UIProfiler.js +87 -190
  158. package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -1
  159. package/build/npm/cjs/prod/profiling/index.js +9 -30
  160. package/build/npm/cjs/prod/profiling/index.js.map +1 -1
  161. package/build/npm/cjs/prod/profiling/integration.js +30 -64
  162. package/build/npm/cjs/prod/profiling/integration.js.map +1 -1
  163. package/build/npm/cjs/prod/profiling/startProfileForSpan.js +28 -84
  164. package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -1
  165. package/build/npm/cjs/prod/profiling/utils.js +131 -398
  166. package/build/npm/cjs/prod/profiling/utils.js.map +1 -1
  167. package/build/npm/cjs/prod/report-dialog.js +10 -25
  168. package/build/npm/cjs/prod/report-dialog.js.map +1 -1
  169. package/build/npm/cjs/prod/sdk.js +5 -73
  170. package/build/npm/cjs/prod/sdk.js.map +1 -1
  171. package/build/npm/cjs/prod/stack-parsers.js +42 -126
  172. package/build/npm/cjs/prod/stack-parsers.js.map +1 -1
  173. package/build/npm/cjs/prod/tracing/backgroundtab.js +4 -16
  174. package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -1
  175. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +102 -291
  176. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -1
  177. package/build/npm/cjs/prod/tracing/linkedTraces.js +25 -117
  178. package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -1
  179. package/build/npm/cjs/prod/tracing/reportPageLoaded.js +1 -9
  180. package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -1
  181. package/build/npm/cjs/prod/tracing/request.js +58 -223
  182. package/build/npm/cjs/prod/tracing/request.js.map +1 -1
  183. package/build/npm/cjs/prod/tracing/setActiveSpan.js +1 -48
  184. package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -1
  185. package/build/npm/cjs/prod/tracing/utils.js +4 -27
  186. package/build/npm/cjs/prod/tracing/utils.js.map +1 -1
  187. package/build/npm/cjs/prod/transports/fetch.js +10 -23
  188. package/build/npm/cjs/prod/transports/fetch.js.map +1 -1
  189. package/build/npm/cjs/prod/transports/offline.js +27 -84
  190. package/build/npm/cjs/prod/transports/offline.js.map +1 -1
  191. package/build/npm/cjs/prod/userfeedback.js +12 -22
  192. package/build/npm/cjs/prod/userfeedback.js.map +1 -1
  193. package/build/npm/cjs/prod/utils/detectBrowserExtension.js +5 -26
  194. package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -1
  195. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +40 -75
  196. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -1
  197. package/build/npm/esm/dev/client.js +15 -54
  198. package/build/npm/esm/dev/client.js.map +1 -1
  199. package/build/npm/esm/dev/debug-build.js +0 -5
  200. package/build/npm/esm/dev/debug-build.js.map +1 -1
  201. package/build/npm/esm/dev/diagnose-sdk.js +15 -37
  202. package/build/npm/esm/dev/diagnose-sdk.js.map +1 -1
  203. package/build/npm/esm/dev/eventbuilder.js +59 -217
  204. package/build/npm/esm/dev/eventbuilder.js.map +1 -1
  205. package/build/npm/esm/dev/feedbackAsync.js +1 -5
  206. package/build/npm/esm/dev/feedbackAsync.js.map +1 -1
  207. package/build/npm/esm/dev/feedbackSync.js +1 -2
  208. package/build/npm/esm/dev/feedbackSync.js.map +1 -1
  209. package/build/npm/esm/dev/helpers.js +24 -102
  210. package/build/npm/esm/dev/helpers.js.map +1 -1
  211. package/build/npm/esm/dev/index.js +1 -0
  212. package/build/npm/esm/dev/index.js.map +1 -1
  213. package/build/npm/esm/dev/integrations/breadcrumbs.js +52 -134
  214. package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -1
  215. package/build/npm/esm/dev/integrations/browserapierrors.js +45 -111
  216. package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -1
  217. package/build/npm/esm/dev/integrations/browsersession.js +7 -35
  218. package/build/npm/esm/dev/integrations/browsersession.js.map +1 -1
  219. package/build/npm/esm/dev/integrations/contextlines.js +9 -45
  220. package/build/npm/esm/dev/integrations/contextlines.js.map +1 -1
  221. package/build/npm/esm/dev/integrations/culturecontext.js +11 -36
  222. package/build/npm/esm/dev/integrations/culturecontext.js.map +1 -1
  223. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js +1 -22
  224. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
  225. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js +6 -31
  226. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  227. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js +6 -12
  228. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
  229. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js +5 -30
  230. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
  231. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js +10 -47
  232. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
  233. package/build/npm/esm/dev/integrations/fetchStreamPerformance.js +58 -0
  234. package/build/npm/esm/dev/integrations/fetchStreamPerformance.js.map +1 -0
  235. package/build/npm/esm/dev/integrations/globalhandlers.js +38 -99
  236. package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -1
  237. package/build/npm/esm/dev/integrations/graphqlClient.js +31 -119
  238. package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -1
  239. package/build/npm/esm/dev/integrations/httpclient.js +43 -203
  240. package/build/npm/esm/dev/integrations/httpclient.js.map +1 -1
  241. package/build/npm/esm/dev/integrations/httpcontext.js +7 -17
  242. package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -1
  243. package/build/npm/esm/dev/integrations/linkederrors.js +7 -15
  244. package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -1
  245. package/build/npm/esm/dev/integrations/reportingobserver.js +19 -44
  246. package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -1
  247. package/build/npm/esm/dev/integrations/spanstreaming.js +11 -29
  248. package/build/npm/esm/dev/integrations/spanstreaming.js.map +1 -1
  249. package/build/npm/esm/dev/integrations/spotlight.js +17 -30
  250. package/build/npm/esm/dev/integrations/spotlight.js.map +1 -1
  251. package/build/npm/esm/dev/integrations/view-hierarchy.js +19 -46
  252. package/build/npm/esm/dev/integrations/view-hierarchy.js.map +1 -1
  253. package/build/npm/esm/dev/integrations/webWorker.js +40 -211
  254. package/build/npm/esm/dev/integrations/webWorker.js.map +1 -1
  255. package/build/npm/esm/dev/package.json +1 -1
  256. package/build/npm/esm/dev/profiling/UIProfiler.js +87 -190
  257. package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -1
  258. package/build/npm/esm/dev/profiling/index.js +9 -30
  259. package/build/npm/esm/dev/profiling/index.js.map +1 -1
  260. package/build/npm/esm/dev/profiling/integration.js +30 -64
  261. package/build/npm/esm/dev/profiling/integration.js.map +1 -1
  262. package/build/npm/esm/dev/profiling/startProfileForSpan.js +28 -84
  263. package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -1
  264. package/build/npm/esm/dev/profiling/utils.js +131 -398
  265. package/build/npm/esm/dev/profiling/utils.js.map +1 -1
  266. package/build/npm/esm/dev/report-dialog.js +10 -25
  267. package/build/npm/esm/dev/report-dialog.js.map +1 -1
  268. package/build/npm/esm/dev/sdk.js +8 -76
  269. package/build/npm/esm/dev/sdk.js.map +1 -1
  270. package/build/npm/esm/dev/stack-parsers.js +42 -126
  271. package/build/npm/esm/dev/stack-parsers.js.map +1 -1
  272. package/build/npm/esm/dev/tracing/backgroundtab.js +4 -16
  273. package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -1
  274. package/build/npm/esm/dev/tracing/browserTracingIntegration.js +102 -291
  275. package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -1
  276. package/build/npm/esm/dev/tracing/linkedTraces.js +25 -116
  277. package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -1
  278. package/build/npm/esm/dev/tracing/reportPageLoaded.js +1 -9
  279. package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -1
  280. package/build/npm/esm/dev/tracing/request.js +59 -224
  281. package/build/npm/esm/dev/tracing/request.js.map +1 -1
  282. package/build/npm/esm/dev/tracing/setActiveSpan.js +1 -48
  283. package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -1
  284. package/build/npm/esm/dev/tracing/utils.js +4 -27
  285. package/build/npm/esm/dev/tracing/utils.js.map +1 -1
  286. package/build/npm/esm/dev/transports/fetch.js +10 -23
  287. package/build/npm/esm/dev/transports/fetch.js.map +1 -1
  288. package/build/npm/esm/dev/transports/offline.js +27 -84
  289. package/build/npm/esm/dev/transports/offline.js.map +1 -1
  290. package/build/npm/esm/dev/userfeedback.js +12 -22
  291. package/build/npm/esm/dev/userfeedback.js.map +1 -1
  292. package/build/npm/esm/dev/utils/detectBrowserExtension.js +5 -26
  293. package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -1
  294. package/build/npm/esm/dev/utils/lazyLoadIntegration.js +40 -75
  295. package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -1
  296. package/build/npm/esm/prod/client.js +15 -54
  297. package/build/npm/esm/prod/client.js.map +1 -1
  298. package/build/npm/esm/prod/debug-build.js +0 -5
  299. package/build/npm/esm/prod/debug-build.js.map +1 -1
  300. package/build/npm/esm/prod/diagnose-sdk.js +15 -37
  301. package/build/npm/esm/prod/diagnose-sdk.js.map +1 -1
  302. package/build/npm/esm/prod/eventbuilder.js +59 -217
  303. package/build/npm/esm/prod/eventbuilder.js.map +1 -1
  304. package/build/npm/esm/prod/feedbackAsync.js +1 -5
  305. package/build/npm/esm/prod/feedbackAsync.js.map +1 -1
  306. package/build/npm/esm/prod/feedbackSync.js +1 -2
  307. package/build/npm/esm/prod/feedbackSync.js.map +1 -1
  308. package/build/npm/esm/prod/helpers.js +24 -102
  309. package/build/npm/esm/prod/helpers.js.map +1 -1
  310. package/build/npm/esm/prod/index.js +1 -0
  311. package/build/npm/esm/prod/index.js.map +1 -1
  312. package/build/npm/esm/prod/integrations/breadcrumbs.js +52 -134
  313. package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -1
  314. package/build/npm/esm/prod/integrations/browserapierrors.js +45 -111
  315. package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -1
  316. package/build/npm/esm/prod/integrations/browsersession.js +7 -35
  317. package/build/npm/esm/prod/integrations/browsersession.js.map +1 -1
  318. package/build/npm/esm/prod/integrations/contextlines.js +9 -45
  319. package/build/npm/esm/prod/integrations/contextlines.js.map +1 -1
  320. package/build/npm/esm/prod/integrations/culturecontext.js +11 -36
  321. package/build/npm/esm/prod/integrations/culturecontext.js.map +1 -1
  322. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +1 -22
  323. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
  324. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +6 -31
  325. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  326. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +6 -12
  327. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
  328. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +5 -30
  329. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
  330. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +10 -47
  331. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
  332. package/build/npm/esm/prod/integrations/fetchStreamPerformance.js +58 -0
  333. package/build/npm/esm/prod/integrations/fetchStreamPerformance.js.map +1 -0
  334. package/build/npm/esm/prod/integrations/globalhandlers.js +38 -99
  335. package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -1
  336. package/build/npm/esm/prod/integrations/graphqlClient.js +31 -119
  337. package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -1
  338. package/build/npm/esm/prod/integrations/httpclient.js +43 -203
  339. package/build/npm/esm/prod/integrations/httpclient.js.map +1 -1
  340. package/build/npm/esm/prod/integrations/httpcontext.js +7 -17
  341. package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -1
  342. package/build/npm/esm/prod/integrations/linkederrors.js +7 -15
  343. package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -1
  344. package/build/npm/esm/prod/integrations/reportingobserver.js +19 -44
  345. package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -1
  346. package/build/npm/esm/prod/integrations/spanstreaming.js +11 -29
  347. package/build/npm/esm/prod/integrations/spanstreaming.js.map +1 -1
  348. package/build/npm/esm/prod/integrations/spotlight.js +17 -30
  349. package/build/npm/esm/prod/integrations/spotlight.js.map +1 -1
  350. package/build/npm/esm/prod/integrations/view-hierarchy.js +19 -46
  351. package/build/npm/esm/prod/integrations/view-hierarchy.js.map +1 -1
  352. package/build/npm/esm/prod/integrations/webWorker.js +40 -211
  353. package/build/npm/esm/prod/integrations/webWorker.js.map +1 -1
  354. package/build/npm/esm/prod/package.json +1 -1
  355. package/build/npm/esm/prod/profiling/UIProfiler.js +87 -190
  356. package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -1
  357. package/build/npm/esm/prod/profiling/index.js +9 -30
  358. package/build/npm/esm/prod/profiling/index.js.map +1 -1
  359. package/build/npm/esm/prod/profiling/integration.js +30 -64
  360. package/build/npm/esm/prod/profiling/integration.js.map +1 -1
  361. package/build/npm/esm/prod/profiling/startProfileForSpan.js +28 -84
  362. package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -1
  363. package/build/npm/esm/prod/profiling/utils.js +131 -398
  364. package/build/npm/esm/prod/profiling/utils.js.map +1 -1
  365. package/build/npm/esm/prod/report-dialog.js +10 -25
  366. package/build/npm/esm/prod/report-dialog.js.map +1 -1
  367. package/build/npm/esm/prod/sdk.js +5 -73
  368. package/build/npm/esm/prod/sdk.js.map +1 -1
  369. package/build/npm/esm/prod/stack-parsers.js +42 -126
  370. package/build/npm/esm/prod/stack-parsers.js.map +1 -1
  371. package/build/npm/esm/prod/tracing/backgroundtab.js +4 -16
  372. package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -1
  373. package/build/npm/esm/prod/tracing/browserTracingIntegration.js +102 -291
  374. package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -1
  375. package/build/npm/esm/prod/tracing/linkedTraces.js +25 -117
  376. package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -1
  377. package/build/npm/esm/prod/tracing/reportPageLoaded.js +1 -9
  378. package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -1
  379. package/build/npm/esm/prod/tracing/request.js +59 -224
  380. package/build/npm/esm/prod/tracing/request.js.map +1 -1
  381. package/build/npm/esm/prod/tracing/setActiveSpan.js +1 -48
  382. package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -1
  383. package/build/npm/esm/prod/tracing/utils.js +4 -27
  384. package/build/npm/esm/prod/tracing/utils.js.map +1 -1
  385. package/build/npm/esm/prod/transports/fetch.js +10 -23
  386. package/build/npm/esm/prod/transports/fetch.js.map +1 -1
  387. package/build/npm/esm/prod/transports/offline.js +27 -84
  388. package/build/npm/esm/prod/transports/offline.js.map +1 -1
  389. package/build/npm/esm/prod/userfeedback.js +12 -22
  390. package/build/npm/esm/prod/userfeedback.js.map +1 -1
  391. package/build/npm/esm/prod/utils/detectBrowserExtension.js +5 -26
  392. package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -1
  393. package/build/npm/esm/prod/utils/lazyLoadIntegration.js +40 -75
  394. package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -1
  395. package/build/npm/types/eventbuilder.d.ts.map +1 -1
  396. package/build/npm/types/helpers.d.ts.map +1 -1
  397. package/build/npm/types/index.bundle.d.ts +2 -2
  398. package/build/npm/types/index.bundle.d.ts.map +1 -1
  399. package/build/npm/types/index.bundle.feedback.d.ts +2 -2
  400. package/build/npm/types/index.bundle.feedback.d.ts.map +1 -1
  401. package/build/npm/types/index.bundle.logs.metrics.d.ts +2 -2
  402. package/build/npm/types/index.bundle.logs.metrics.d.ts.map +1 -1
  403. package/build/npm/types/index.bundle.replay.d.ts +2 -2
  404. package/build/npm/types/index.bundle.replay.d.ts.map +1 -1
  405. package/build/npm/types/index.bundle.replay.feedback.d.ts +2 -2
  406. package/build/npm/types/index.bundle.replay.feedback.d.ts.map +1 -1
  407. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts +2 -2
  408. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts.map +1 -1
  409. package/build/npm/types/index.bundle.tracing.d.ts +1 -0
  410. package/build/npm/types/index.bundle.tracing.d.ts.map +1 -1
  411. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts +1 -0
  412. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts.map +1 -1
  413. package/build/npm/types/index.bundle.tracing.replay.d.ts +1 -0
  414. package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -1
  415. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +1 -0
  416. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -1
  417. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -0
  418. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts.map +1 -1
  419. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts +1 -0
  420. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts.map +1 -1
  421. package/build/npm/types/index.d.ts +1 -0
  422. package/build/npm/types/index.d.ts.map +1 -1
  423. package/build/npm/types/integrations/fetchStreamPerformance.d.ts +14 -0
  424. package/build/npm/types/integrations/fetchStreamPerformance.d.ts.map +1 -0
  425. package/build/npm/types/tracing/browserTracingIntegration.d.ts +3 -0
  426. package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
  427. package/build/npm/types/tracing/request.d.ts +3 -0
  428. package/build/npm/types/tracing/request.d.ts.map +1 -1
  429. package/build/npm/types-ts3.8/index.bundle.d.ts +2 -2
  430. package/build/npm/types-ts3.8/index.bundle.feedback.d.ts +2 -2
  431. package/build/npm/types-ts3.8/index.bundle.logs.metrics.d.ts +2 -2
  432. package/build/npm/types-ts3.8/index.bundle.replay.d.ts +2 -2
  433. package/build/npm/types-ts3.8/index.bundle.replay.feedback.d.ts +2 -2
  434. package/build/npm/types-ts3.8/index.bundle.replay.logs.metrics.d.ts +2 -2
  435. package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +1 -0
  436. package/build/npm/types-ts3.8/index.bundle.tracing.logs.metrics.d.ts +1 -0
  437. package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +1 -0
  438. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +1 -0
  439. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -0
  440. package/build/npm/types-ts3.8/index.bundle.tracing.replay.logs.metrics.d.ts +1 -0
  441. package/build/npm/types-ts3.8/index.d.ts +1 -0
  442. package/build/npm/types-ts3.8/integrations/fetchStreamPerformance.d.ts +14 -0
  443. package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +3 -0
  444. package/build/npm/types-ts3.8/tracing/request.d.ts +3 -0
  445. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"contextlines.js","sources":["../../../../../src/integrations/contextlines.ts"],"sourcesContent":["import type { Event, IntegrationFn, StackFrame } from '@sentry/core/browser';\nimport { addContextToFrame, defineIntegration, GLOBAL_OBJ, stripUrlQueryAndFragment } from '@sentry/core/browser';\n\nconst WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nconst DEFAULT_LINES_OF_CONTEXT = 7;\n\nconst INTEGRATION_NAME = 'ContextLines';\n\ninterface ContextLinesOptions {\n /**\n * Sets the number of context lines for each frame when loading a file.\n * Defaults to 7.\n *\n * Set to 0 to disable loading and inclusion of source files.\n **/\n frameContextLines?: number;\n}\n\nconst _contextLinesIntegration = ((options: ContextLinesOptions = {}) => {\n const contextLines = options.frameContextLines != null ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;\n\n return {\n name: INTEGRATION_NAME,\n processEvent(event) {\n return addSourceContext(event, contextLines);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Collects source context lines around the lines of stackframes pointing to JS embedded in\n * the current page's HTML.\n *\n * This integration DOES NOT work for stack frames pointing to JS files that are loaded by the browser.\n * For frames pointing to files, context lines are added during ingestion and symbolication\n * by attempting to download the JS files to the Sentry backend.\n *\n * Use this integration if you have inline JS code in HTML pages that can't be accessed\n * by our backend (e.g. due to a login-protected page).\n */\nexport const contextLinesIntegration = defineIntegration(_contextLinesIntegration);\n\n/**\n * Processes an event and adds context lines.\n */\nfunction addSourceContext(event: Event, contextLines: number): Event {\n const doc = WINDOW.document;\n const htmlFilename = WINDOW.location && stripUrlQueryAndFragment(WINDOW.location.href);\n if (!doc || !htmlFilename) {\n return event;\n }\n\n const exceptions = event.exception?.values;\n if (!exceptions?.length) {\n return event;\n }\n\n const html = doc.documentElement.innerHTML;\n if (!html) {\n return event;\n }\n\n const htmlLines = ['<!DOCTYPE html>', '<html>', ...html.split('\\n'), '</html>'];\n\n exceptions.forEach(exception => {\n const stacktrace = exception.stacktrace;\n if (stacktrace?.frames) {\n stacktrace.frames = stacktrace.frames.map(frame =>\n applySourceContextToFrame(frame, htmlLines, htmlFilename, contextLines),\n );\n }\n });\n\n return event;\n}\n\n/**\n * Only exported for testing\n */\nexport function applySourceContextToFrame(\n frame: StackFrame,\n htmlLines: string[],\n htmlFilename: string,\n linesOfContext: number,\n): StackFrame {\n if (frame.filename !== htmlFilename || !frame.lineno || !htmlLines.length) {\n return frame;\n }\n\n addContextToFrame(htmlLines, frame, linesOfContext);\n\n return frame;\n}\n"],"names":[],"mappings":";;AAGA,MAAM,MAAA,GAAS,UAAA;;AAEf,MAAM,wBAAA,GAA2B,CAAC;;AAElC,MAAM,gBAAA,GAAmB,cAAc;;AAYvC,MAAM,wBAAA,IAA4B,CAAC,OAAO,GAAwB,EAAE,KAAK;AACzE,EAAE,MAAM,YAAA,GAAe,OAAO,CAAC,iBAAA,IAAqB,IAAA,GAAO,OAAO,CAAC,iBAAA,GAAoB,wBAAwB;;AAE/G,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,YAAY,CAAC,KAAK,EAAE;AACxB,MAAM,OAAO,gBAAgB,CAAC,KAAK,EAAE,YAAY,CAAC;AAClD,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,uBAAA,GAA0B,iBAAiB,CAAC,wBAAwB;;AAEjF;AACA;AACA;AACA,SAAS,gBAAgB,CAAC,KAAK,EAAS,YAAY,EAAiB;AACrE,EAAE,MAAM,GAAA,GAAM,MAAM,CAAC,QAAQ;AAC7B,EAAE,MAAM,YAAA,GAAe,MAAM,CAAC,QAAA,IAAY,wBAAwB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;AACxF,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;AAC7B,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,UAAA,GAAa,KAAK,CAAC,SAAS,EAAE,MAAM;AAC5C,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE;AAC3B,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,IAAA,GAAO,GAAG,CAAC,eAAe,CAAC,SAAS;AAC5C,EAAE,IAAI,CAAC,IAAI,EAAE;AACb,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,SAAA,GAAY,CAAC,iBAAiB,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;;AAEjF,EAAE,UAAU,CAAC,OAAO,CAAC,aAAa;AAClC,IAAI,MAAM,UAAA,GAAa,SAAS,CAAC,UAAU;AAC3C,IAAI,IAAI,UAAU,EAAE,MAAM,EAAE;AAC5B,MAAM,UAAU,CAAC,MAAA,GAAS,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,KAAA;AAChD,QAAQ,yBAAyB,CAAC,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,CAAC;AAC/E,OAAO;AACP,IAAI;AACJ,EAAE,CAAC,CAAC;;AAEJ,EAAE,OAAO,KAAK;AACd;;AAEA;AACA;AACA;AACO,SAAS,yBAAyB;AACzC,EAAE,KAAK;AACP,EAAE,SAAS;AACX,EAAE,YAAY;AACd,EAAE,cAAc;AAChB,EAAc;AACd,EAAE,IAAI,KAAK,CAAC,QAAA,KAAa,YAAA,IAAgB,CAAC,KAAK,CAAC,MAAA,IAAU,CAAC,SAAS,CAAC,MAAM,EAAE;AAC7E,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,iBAAiB,CAAC,SAAS,EAAE,KAAK,EAAE,cAAc,CAAC;;AAErD,EAAE,OAAO,KAAK;AACd;;;;"}
1
+ {"version":3,"file":"contextlines.js","sources":["../../../../../src/integrations/contextlines.ts"],"sourcesContent":["import type { Event, IntegrationFn, StackFrame } from '@sentry/core/browser';\nimport { addContextToFrame, defineIntegration, GLOBAL_OBJ, stripUrlQueryAndFragment } from '@sentry/core/browser';\n\nconst WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nconst DEFAULT_LINES_OF_CONTEXT = 7;\n\nconst INTEGRATION_NAME = 'ContextLines';\n\ninterface ContextLinesOptions {\n /**\n * Sets the number of context lines for each frame when loading a file.\n * Defaults to 7.\n *\n * Set to 0 to disable loading and inclusion of source files.\n **/\n frameContextLines?: number;\n}\n\nconst _contextLinesIntegration = ((options: ContextLinesOptions = {}) => {\n const contextLines = options.frameContextLines != null ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;\n\n return {\n name: INTEGRATION_NAME,\n processEvent(event) {\n return addSourceContext(event, contextLines);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Collects source context lines around the lines of stackframes pointing to JS embedded in\n * the current page's HTML.\n *\n * This integration DOES NOT work for stack frames pointing to JS files that are loaded by the browser.\n * For frames pointing to files, context lines are added during ingestion and symbolication\n * by attempting to download the JS files to the Sentry backend.\n *\n * Use this integration if you have inline JS code in HTML pages that can't be accessed\n * by our backend (e.g. due to a login-protected page).\n */\nexport const contextLinesIntegration = defineIntegration(_contextLinesIntegration);\n\n/**\n * Processes an event and adds context lines.\n */\nfunction addSourceContext(event: Event, contextLines: number): Event {\n const doc = WINDOW.document;\n const htmlFilename = WINDOW.location && stripUrlQueryAndFragment(WINDOW.location.href);\n if (!doc || !htmlFilename) {\n return event;\n }\n\n const exceptions = event.exception?.values;\n if (!exceptions?.length) {\n return event;\n }\n\n const html = doc.documentElement.innerHTML;\n if (!html) {\n return event;\n }\n\n const htmlLines = ['<!DOCTYPE html>', '<html>', ...html.split('\\n'), '</html>'];\n\n exceptions.forEach(exception => {\n const stacktrace = exception.stacktrace;\n if (stacktrace?.frames) {\n stacktrace.frames = stacktrace.frames.map(frame =>\n applySourceContextToFrame(frame, htmlLines, htmlFilename, contextLines),\n );\n }\n });\n\n return event;\n}\n\n/**\n * Only exported for testing\n */\nexport function applySourceContextToFrame(\n frame: StackFrame,\n htmlLines: string[],\n htmlFilename: string,\n linesOfContext: number,\n): StackFrame {\n if (frame.filename !== htmlFilename || !frame.lineno || !htmlLines.length) {\n return frame;\n }\n\n addContextToFrame(htmlLines, frame, linesOfContext);\n\n return frame;\n}\n"],"names":[],"mappings":";;AAGA,MAAM,MAAA,GAAS,UAAA;AAEf,MAAM,wBAAA,GAA2B,CAAA;AAEjC,MAAM,gBAAA,GAAmB,cAAA;AAYzB,MAAM,wBAAA,IAA4B,CAAC,OAAA,GAA+B,EAAC,KAAM;AACvE,EAAA,MAAM,YAAA,GAAe,OAAA,CAAQ,iBAAA,IAAqB,IAAA,GAAO,QAAQ,iBAAA,GAAoB,wBAAA;AAErF,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,aAAa,KAAA,EAAO;AAClB,MAAA,OAAO,gBAAA,CAAiB,OAAO,YAAY,CAAA;AAAA,IAC7C;AAAA,GACF;AACF,CAAA,CAAA;AAaO,MAAM,uBAAA,GAA0B,kBAAkB,wBAAwB;AAKjF,SAAS,gBAAA,CAAiB,OAAc,YAAA,EAA6B;AACnE,EAAA,MAAM,MAAM,MAAA,CAAO,QAAA;AACnB,EAAA,MAAM,eAAe,MAAA,CAAO,QAAA,IAAY,wBAAA,CAAyB,MAAA,CAAO,SAAS,IAAI,CAAA;AACrF,EAAA,IAAI,CAAC,GAAA,IAAO,CAAC,YAAA,EAAc;AACzB,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,MAAM,UAAA,GAAa,MAAM,SAAA,EAAW,MAAA;AACpC,EAAA,IAAI,CAAC,YAAY,MAAA,EAAQ;AACvB,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,MAAM,IAAA,GAAO,IAAI,eAAA,CAAgB,SAAA;AACjC,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,MAAM,SAAA,GAAY,CAAC,iBAAA,EAAmB,QAAA,EAAU,GAAG,IAAA,CAAK,KAAA,CAAM,IAAI,CAAA,EAAG,SAAS,CAAA;AAE9E,EAAA,UAAA,CAAW,QAAQ,CAAA,SAAA,KAAa;AAC9B,IAAA,MAAM,aAAa,SAAA,CAAU,UAAA;AAC7B,IAAA,IAAI,YAAY,MAAA,EAAQ;AACtB,MAAA,UAAA,CAAW,MAAA,GAAS,WAAW,MAAA,CAAO,GAAA;AAAA,QAAI,CAAA,KAAA,KACxC,yBAAA,CAA0B,KAAA,EAAO,SAAA,EAAW,cAAc,YAAY;AAAA,OACxE;AAAA,IACF;AAAA,EACF,CAAC,CAAA;AAED,EAAA,OAAO,KAAA;AACT;AAKO,SAAS,yBAAA,CACd,KAAA,EACA,SAAA,EACA,YAAA,EACA,cAAA,EACY;AACZ,EAAA,IAAI,KAAA,CAAM,aAAa,YAAA,IAAgB,CAAC,MAAM,MAAA,IAAU,CAAC,UAAU,MAAA,EAAQ;AACzE,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,iBAAA,CAAkB,SAAA,EAAW,OAAO,cAAc,CAAA;AAElD,EAAA,OAAO,KAAA;AACT;;;;"}
@@ -1,71 +1,46 @@
1
1
  import { defineIntegration, safeSetSpanJSONAttributes } from '@sentry/core/browser';
2
2
  import { WINDOW } from '../helpers.js';
3
3
 
4
- const INTEGRATION_NAME = 'CultureContext';
5
-
4
+ const INTEGRATION_NAME = "CultureContext";
6
5
  const _cultureContextIntegration = (() => {
7
6
  return {
8
7
  name: INTEGRATION_NAME,
9
8
  preprocessEvent(event) {
10
9
  const culture = getCultureContext();
11
-
12
10
  if (culture) {
13
11
  event.contexts = {
14
12
  ...event.contexts,
15
- culture: { ...culture, ...event.contexts?.culture },
13
+ culture: { ...culture, ...event.contexts?.culture }
16
14
  };
17
15
  }
18
16
  },
19
17
  processSegmentSpan(span) {
20
18
  const culture = getCultureContext();
21
-
22
19
  if (culture) {
23
20
  safeSetSpanJSONAttributes(span, {
24
- 'culture.locale': culture.locale,
25
- 'culture.timezone': culture.timezone,
26
- 'culture.calendar': culture.calendar,
21
+ "culture.locale": culture.locale,
22
+ "culture.timezone": culture.timezone,
23
+ "culture.calendar": culture.calendar
27
24
  });
28
25
  }
29
- },
26
+ }
30
27
  };
31
- }) ;
32
-
33
- /**
34
- * Captures culture context from the browser.
35
- *
36
- * Enabled by default.
37
- *
38
- * @example
39
- * ```js
40
- * import * as Sentry from '@sentry/browser';
41
- *
42
- * Sentry.init({
43
- * integrations: [Sentry.cultureContextIntegration()],
44
- * });
45
- * ```
46
- */
28
+ });
47
29
  const cultureContextIntegration = defineIntegration(_cultureContextIntegration);
48
-
49
- /**
50
- * Returns the culture context from the browser's Intl API.
51
- */
52
30
  function getCultureContext() {
53
31
  try {
54
- const intl = (WINDOW ).Intl;
32
+ const intl = WINDOW.Intl;
55
33
  if (!intl) {
56
- return undefined;
34
+ return void 0;
57
35
  }
58
-
59
36
  const options = intl.DateTimeFormat().resolvedOptions();
60
-
61
37
  return {
62
38
  locale: options.locale,
63
39
  timezone: options.timeZone,
64
- calendar: options.calendar,
40
+ calendar: options.calendar
65
41
  };
66
42
  } catch {
67
- // Ignore errors
68
- return undefined;
43
+ return void 0;
69
44
  }
70
45
  }
71
46
 
@@ -1 +1 @@
1
- {"version":3,"file":"culturecontext.js","sources":["../../../../../src/integrations/culturecontext.ts"],"sourcesContent":["import type { CultureContext, IntegrationFn } from '@sentry/core/browser';\nimport { defineIntegration, safeSetSpanJSONAttributes } from '@sentry/core/browser';\nimport { WINDOW } from '../helpers';\n\nconst INTEGRATION_NAME = 'CultureContext';\n\nconst _cultureContextIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n preprocessEvent(event) {\n const culture = getCultureContext();\n\n if (culture) {\n event.contexts = {\n ...event.contexts,\n culture: { ...culture, ...event.contexts?.culture },\n };\n }\n },\n processSegmentSpan(span) {\n const culture = getCultureContext();\n\n if (culture) {\n safeSetSpanJSONAttributes(span, {\n 'culture.locale': culture.locale,\n 'culture.timezone': culture.timezone,\n 'culture.calendar': culture.calendar,\n });\n }\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Captures culture context from the browser.\n *\n * Enabled by default.\n *\n * @example\n * ```js\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * integrations: [Sentry.cultureContextIntegration()],\n * });\n * ```\n */\nexport const cultureContextIntegration = defineIntegration(_cultureContextIntegration);\n\n/**\n * Returns the culture context from the browser's Intl API.\n */\nfunction getCultureContext(): CultureContext | undefined {\n try {\n const intl = (WINDOW as { Intl?: typeof Intl }).Intl;\n if (!intl) {\n return undefined;\n }\n\n const options = intl.DateTimeFormat().resolvedOptions();\n\n return {\n locale: options.locale,\n timezone: options.timeZone,\n calendar: options.calendar,\n };\n } catch {\n // Ignore errors\n return undefined;\n }\n}\n"],"names":[],"mappings":";;;AAIA,MAAM,gBAAA,GAAmB,gBAAgB;;AAEzC,MAAM,0BAAA,IAA8B,MAAM;AAC1C,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,eAAe,CAAC,KAAK,EAAE;AAC3B,MAAM,MAAM,OAAA,GAAU,iBAAiB,EAAE;;AAEzC,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,KAAK,CAAC,QAAA,GAAW;AACzB,UAAU,GAAG,KAAK,CAAC,QAAQ;AAC3B,UAAU,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,OAAA,EAAS;AAC7D,SAAS;AACT,MAAM;AACN,IAAI,CAAC;AACL,IAAI,kBAAkB,CAAC,IAAI,EAAE;AAC7B,MAAM,MAAM,OAAA,GAAU,iBAAiB,EAAE;;AAEzC,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,yBAAyB,CAAC,IAAI,EAAE;AACxC,UAAU,gBAAgB,EAAE,OAAO,CAAC,MAAM;AAC1C,UAAU,kBAAkB,EAAE,OAAO,CAAC,QAAQ;AAC9C,UAAU,kBAAkB,EAAE,OAAO,CAAC,QAAQ;AAC9C,SAAS,CAAC;AACV,MAAM;AACN,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,yBAAA,GAA4B,iBAAiB,CAAC,0BAA0B;;AAErF;AACA;AACA;AACA,SAAS,iBAAiB,GAA+B;AACzD,EAAE,IAAI;AACN,IAAI,MAAM,IAAA,GAAO,CAAC,MAAA,GAAkC,IAAI;AACxD,IAAI,IAAI,CAAC,IAAI,EAAE;AACf,MAAM,OAAO,SAAS;AACtB,IAAI;;AAEJ,IAAI,MAAM,OAAA,GAAU,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE;;AAE3D,IAAI,OAAO;AACX,MAAM,MAAM,EAAE,OAAO,CAAC,MAAM;AAC5B,MAAM,QAAQ,EAAE,OAAO,CAAC,QAAQ;AAChC,MAAM,QAAQ,EAAE,OAAO,CAAC,QAAQ;AAChC,KAAK;AACL,EAAE,EAAE,MAAM;AACV;AACA,IAAI,OAAO,SAAS;AACpB,EAAE;AACF;;;;"}
1
+ {"version":3,"file":"culturecontext.js","sources":["../../../../../src/integrations/culturecontext.ts"],"sourcesContent":["import type { CultureContext, IntegrationFn } from '@sentry/core/browser';\nimport { defineIntegration, safeSetSpanJSONAttributes } from '@sentry/core/browser';\nimport { WINDOW } from '../helpers';\n\nconst INTEGRATION_NAME = 'CultureContext';\n\nconst _cultureContextIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n preprocessEvent(event) {\n const culture = getCultureContext();\n\n if (culture) {\n event.contexts = {\n ...event.contexts,\n culture: { ...culture, ...event.contexts?.culture },\n };\n }\n },\n processSegmentSpan(span) {\n const culture = getCultureContext();\n\n if (culture) {\n safeSetSpanJSONAttributes(span, {\n 'culture.locale': culture.locale,\n 'culture.timezone': culture.timezone,\n 'culture.calendar': culture.calendar,\n });\n }\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Captures culture context from the browser.\n *\n * Enabled by default.\n *\n * @example\n * ```js\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * integrations: [Sentry.cultureContextIntegration()],\n * });\n * ```\n */\nexport const cultureContextIntegration = defineIntegration(_cultureContextIntegration);\n\n/**\n * Returns the culture context from the browser's Intl API.\n */\nfunction getCultureContext(): CultureContext | undefined {\n try {\n const intl = (WINDOW as { Intl?: typeof Intl }).Intl;\n if (!intl) {\n return undefined;\n }\n\n const options = intl.DateTimeFormat().resolvedOptions();\n\n return {\n locale: options.locale,\n timezone: options.timeZone,\n calendar: options.calendar,\n };\n } catch {\n // Ignore errors\n return undefined;\n }\n}\n"],"names":[],"mappings":";;;AAIA,MAAM,gBAAA,GAAmB,gBAAA;AAEzB,MAAM,8BAA8B,MAAM;AACxC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,gBAAgB,KAAA,EAAO;AACrB,MAAA,MAAM,UAAU,iBAAA,EAAkB;AAElC,MAAA,IAAI,OAAA,EAAS;AACX,QAAA,KAAA,CAAM,QAAA,GAAW;AAAA,UACf,GAAG,KAAA,CAAM,QAAA;AAAA,UACT,SAAS,EAAE,GAAG,SAAS,GAAG,KAAA,CAAM,UAAU,OAAA;AAAQ,SACpD;AAAA,MACF;AAAA,IACF,CAAA;AAAA,IACA,mBAAmB,IAAA,EAAM;AACvB,MAAA,MAAM,UAAU,iBAAA,EAAkB;AAElC,MAAA,IAAI,OAAA,EAAS;AACX,QAAA,yBAAA,CAA0B,IAAA,EAAM;AAAA,UAC9B,kBAAkB,OAAA,CAAQ,MAAA;AAAA,UAC1B,oBAAoB,OAAA,CAAQ,QAAA;AAAA,UAC5B,oBAAoB,OAAA,CAAQ;AAAA,SAC7B,CAAA;AAAA,MACH;AAAA,IACF;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,yBAAA,GAA4B,kBAAkB,0BAA0B;AAKrF,SAAS,iBAAA,GAAgD;AACvD,EAAA,IAAI;AACF,IAAA,MAAM,OAAQ,MAAA,CAAkC,IAAA;AAChD,IAAA,IAAI,CAAC,IAAA,EAAM;AACT,MAAA,OAAO,KAAA,CAAA;AAAA,IACT;AAEA,IAAA,MAAM,OAAA,GAAU,IAAA,CAAK,cAAA,EAAe,CAAE,eAAA,EAAgB;AAEtD,IAAA,OAAO;AAAA,MACL,QAAQ,OAAA,CAAQ,MAAA;AAAA,MAChB,UAAU,OAAA,CAAQ,QAAA;AAAA,MAClB,UAAU,OAAA,CAAQ;AAAA,KACpB;AAAA,EACF,CAAA,CAAA,MAAQ;AAEN,IAAA,OAAO,MAAA;AAAA,EACT;AACF;;;;"}
@@ -1,27 +1,6 @@
1
1
  import { growthbookIntegration as growthbookIntegration$1 } from '@sentry/core/browser';
2
2
 
3
- /**
4
- * Sentry integration for capturing feature flag evaluations from GrowthBook.
5
- *
6
- * See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags
7
- *
8
- * @example
9
- * ```
10
- * import { GrowthBook } from '@growthbook/growthbook';
11
- * import * as Sentry from '@sentry/browser';
12
- *
13
- * Sentry.init({
14
- * dsn: '___PUBLIC_DSN___',
15
- * integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],
16
- * });
17
- *
18
- * const gb = new GrowthBook();
19
- * gb.isOn('my-feature');
20
- * Sentry.captureException(new Error('something went wrong'));
21
- * ```
22
- */
23
- const growthbookIntegration = (({ growthbookClass }) =>
24
- growthbookIntegration$1({ growthbookClass })) ;
3
+ const growthbookIntegration = (({ growthbookClass }) => growthbookIntegration$1({ growthbookClass }));
25
4
 
26
5
  export { growthbookIntegration };
27
6
  //# sourceMappingURL=integration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/growthbook/integration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core/browser';\nimport { growthbookIntegration as coreGrowthbookIntegration } from '@sentry/core/browser';\nimport type { GrowthBookClass } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from GrowthBook.\n *\n * See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags\n *\n * @example\n * ```\n * import { GrowthBook } from '@growthbook/growthbook';\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],\n * });\n *\n * const gb = new GrowthBook();\n * gb.isOn('my-feature');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const growthbookIntegration = (({ growthbookClass }: { growthbookClass: GrowthBookClass }) =>\n coreGrowthbookIntegration({ growthbookClass })) satisfies IntegrationFn;\n"],"names":["coreGrowthbookIntegration"],"mappings":";;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,yBAAyB,CAAC,EAAE,eAAA,EAAiB;AAC1D,EAAEA,uBAAyB,CAAC,EAAE,eAAA,EAAiB,CAAC,CAAA;;;;"}
1
+ {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/growthbook/integration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core/browser';\nimport { growthbookIntegration as coreGrowthbookIntegration } from '@sentry/core/browser';\nimport type { GrowthBookClass } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from GrowthBook.\n *\n * See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags\n *\n * @example\n * ```\n * import { GrowthBook } from '@growthbook/growthbook';\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],\n * });\n *\n * const gb = new GrowthBook();\n * gb.isOn('my-feature');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const growthbookIntegration = (({ growthbookClass }: { growthbookClass: GrowthBookClass }) =>\n coreGrowthbookIntegration({ growthbookClass })) satisfies IntegrationFn;\n"],"names":["coreGrowthbookIntegration"],"mappings":";;AAwBO,MAAM,qBAAA,IAAyB,CAAC,EAAE,eAAA,OACvCA,uBAAA,CAA0B,EAAE,iBAAiB,CAAA;;;;"}
@@ -1,50 +1,25 @@
1
1
  import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan } from '@sentry/core/browser';
2
2
 
3
- /**
4
- * Sentry integration for capturing feature flag evaluations from LaunchDarkly.
5
- *
6
- * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
7
- *
8
- * @example
9
- * ```
10
- * import * as Sentry from '@sentry/browser';
11
- * import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';
12
- * import * as LaunchDarkly from 'launchdarkly-js-client-sdk';
13
- *
14
- * Sentry.init(..., integrations: [launchDarklyIntegration()])
15
- * const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});
16
- * ```
17
- */
18
3
  const launchDarklyIntegration = defineIntegration(() => {
19
4
  return {
20
- name: 'LaunchDarkly',
21
-
5
+ name: "LaunchDarkly",
22
6
  processEvent(event, _hint, _client) {
23
7
  return _INTERNAL_copyFlagsFromScopeToEvent(event);
24
- },
8
+ }
25
9
  };
26
- }) ;
27
-
28
- /**
29
- * LaunchDarkly hook to listen for and buffer flag evaluations. This needs to
30
- * be registered as an 'inspector' in LaunchDarkly initialize() options,
31
- * separately from `launchDarklyIntegration`. Both the hook and the integration
32
- * are needed to capture LaunchDarkly flags.
33
- */
10
+ });
34
11
  function buildLaunchDarklyFlagUsedHandler() {
35
12
  return {
36
- name: 'sentry-flag-auditor',
37
- type: 'flag-used',
38
-
13
+ name: "sentry-flag-auditor",
14
+ type: "flag-used",
39
15
  synchronous: true,
40
-
41
16
  /**
42
17
  * Handle a flag evaluation by storing its name and value on the current scope.
43
18
  */
44
19
  method: (flagKey, flagDetail, _context) => {
45
20
  _INTERNAL_insertFlagToScope(flagKey, flagDetail.value);
46
21
  _INTERNAL_addFeatureFlagToActiveSpan(flagKey, flagDetail.value);
47
- },
22
+ }
48
23
  };
49
24
  }
50
25
 
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/launchdarkly/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core/browser';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core/browser';\nimport type { LDContext, LDEvaluationDetail, LDInspectionFlagUsedHandler } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from LaunchDarkly.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import * as Sentry from '@sentry/browser';\n * import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';\n * import * as LaunchDarkly from 'launchdarkly-js-client-sdk';\n *\n * Sentry.init(..., integrations: [launchDarklyIntegration()])\n * const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});\n * ```\n */\nexport const launchDarklyIntegration = defineIntegration(() => {\n return {\n name: 'LaunchDarkly',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * LaunchDarkly hook to listen for and buffer flag evaluations. This needs to\n * be registered as an 'inspector' in LaunchDarkly initialize() options,\n * separately from `launchDarklyIntegration`. Both the hook and the integration\n * are needed to capture LaunchDarkly flags.\n */\nexport function buildLaunchDarklyFlagUsedHandler(): LDInspectionFlagUsedHandler {\n return {\n name: 'sentry-flag-auditor',\n type: 'flag-used',\n\n synchronous: true,\n\n /**\n * Handle a flag evaluation by storing its name and value on the current scope.\n */\n method: (flagKey: string, flagDetail: LDEvaluationDetail, _context: LDContext) => {\n _INTERNAL_insertFlagToScope(flagKey, flagDetail.value);\n _INTERNAL_addFeatureFlagToActiveSpan(flagKey, flagDetail.value);\n },\n };\n}\n"],"names":[],"mappings":";;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,uBAAA,GAA0B,iBAAiB,CAAC,MAAM;AAC/D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,cAAc;;AAExB,IAAI,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AACzE,MAAM,OAAO,mCAAmC,CAAC,KAAK,CAAC;AACvD,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gCAAgC,GAAgC;AAChF,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,qBAAqB;AAC/B,IAAI,IAAI,EAAE,WAAW;;AAErB,IAAI,WAAW,EAAE,IAAI;;AAErB;AACA;AACA;AACA,IAAI,MAAM,EAAE,CAAC,OAAO,EAAU,UAAU,EAAsB,QAAQ,KAAgB;AACtF,MAAM,2BAA2B,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC;AAC5D,MAAM,oCAAoC,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC;AACrE,IAAI,CAAC;AACL,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/launchdarkly/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core/browser';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core/browser';\nimport type { LDContext, LDEvaluationDetail, LDInspectionFlagUsedHandler } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from LaunchDarkly.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import * as Sentry from '@sentry/browser';\n * import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';\n * import * as LaunchDarkly from 'launchdarkly-js-client-sdk';\n *\n * Sentry.init(..., integrations: [launchDarklyIntegration()])\n * const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});\n * ```\n */\nexport const launchDarklyIntegration = defineIntegration(() => {\n return {\n name: 'LaunchDarkly',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * LaunchDarkly hook to listen for and buffer flag evaluations. This needs to\n * be registered as an 'inspector' in LaunchDarkly initialize() options,\n * separately from `launchDarklyIntegration`. Both the hook and the integration\n * are needed to capture LaunchDarkly flags.\n */\nexport function buildLaunchDarklyFlagUsedHandler(): LDInspectionFlagUsedHandler {\n return {\n name: 'sentry-flag-auditor',\n type: 'flag-used',\n\n synchronous: true,\n\n /**\n * Handle a flag evaluation by storing its name and value on the current scope.\n */\n method: (flagKey: string, flagDetail: LDEvaluationDetail, _context: LDContext) => {\n _INTERNAL_insertFlagToScope(flagKey, flagDetail.value);\n _INTERNAL_addFeatureFlagToActiveSpan(flagKey, flagDetail.value);\n },\n };\n}\n"],"names":[],"mappings":";;AAwBO,MAAM,uBAAA,GAA0B,kBAAkB,MAAM;AAC7D,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,cAAA;AAAA,IAEN,YAAA,CAAa,KAAA,EAAc,KAAA,EAAkB,OAAA,EAAwB;AACnE,MAAA,OAAO,oCAAoC,KAAK,CAAA;AAAA,IAClD;AAAA,GACF;AACF,CAAC;AAQM,SAAS,gCAAA,GAAgE;AAC9E,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,qBAAA;AAAA,IACN,IAAA,EAAM,WAAA;AAAA,IAEN,WAAA,EAAa,IAAA;AAAA;AAAA;AAAA;AAAA,IAKb,MAAA,EAAQ,CAAC,OAAA,EAAiB,UAAA,EAAgC,QAAA,KAAwB;AAChF,MAAA,2BAAA,CAA4B,OAAA,EAAS,WAAW,KAAK,CAAA;AACrD,MAAA,oCAAA,CAAqC,OAAA,EAAS,WAAW,KAAK,CAAA;AAAA,IAChE;AAAA,GACF;AACF;;;;"}
@@ -2,30 +2,24 @@ import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_inser
2
2
 
3
3
  const openFeatureIntegration = defineIntegration(() => {
4
4
  return {
5
- name: 'OpenFeature',
6
-
5
+ name: "OpenFeature",
7
6
  processEvent(event, _hint, _client) {
8
7
  return _INTERNAL_copyFlagsFromScopeToEvent(event);
9
- },
8
+ }
10
9
  };
11
- }) ;
12
-
13
- /**
14
- * OpenFeature Hook class implementation.
15
- */
16
- class OpenFeatureIntegrationHook {
10
+ });
11
+ class OpenFeatureIntegrationHook {
17
12
  /**
18
13
  * Successful evaluation result.
19
14
  */
20
- after(_hookContext, evaluationDetails) {
15
+ after(_hookContext, evaluationDetails) {
21
16
  _INTERNAL_insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);
22
17
  _INTERNAL_addFeatureFlagToActiveSpan(evaluationDetails.flagKey, evaluationDetails.value);
23
18
  }
24
-
25
19
  /**
26
20
  * On error evaluation result.
27
21
  */
28
- error(hookContext, _error, _hookHints) {
22
+ error(hookContext, _error, _hookHints) {
29
23
  _INTERNAL_insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);
30
24
  _INTERNAL_addFeatureFlagToActiveSpan(hookContext.flagKey, hookContext.defaultValue);
31
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/openfeature/integration.ts"],"sourcesContent":["/**\n * Sentry integration for capturing OpenFeature feature flag evaluations.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import * as Sentry from \"@sentry/browser\";\n * import { OpenFeature } from \"@openfeature/web-sdk\";\n *\n * Sentry.init(..., integrations: [Sentry.openFeatureIntegration()]);\n * OpenFeature.setProvider(new MyProviderOfChoice());\n * OpenFeature.addHooks(new Sentry.OpenFeatureIntegrationHook());\n * ```\n */\nimport type { Client, Event, EventHint, IntegrationFn } from '@sentry/core/browser';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core/browser';\nimport type { EvaluationDetails, HookContext, HookHints, JsonValue, OpenFeatureHook } from './types';\n\nexport const openFeatureIntegration = defineIntegration(() => {\n return {\n name: 'OpenFeature',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * OpenFeature Hook class implementation.\n */\nexport class OpenFeatureIntegrationHook implements OpenFeatureHook {\n /**\n * Successful evaluation result.\n */\n public after(_hookContext: Readonly<HookContext<JsonValue>>, evaluationDetails: EvaluationDetails<JsonValue>): void {\n _INTERNAL_insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);\n _INTERNAL_addFeatureFlagToActiveSpan(evaluationDetails.flagKey, evaluationDetails.value);\n }\n\n /**\n * On error evaluation result.\n */\n public error(hookContext: Readonly<HookContext<JsonValue>>, _error: unknown, _hookHints?: HookHints): void {\n _INTERNAL_insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);\n _INTERNAL_addFeatureFlagToActiveSpan(hookContext.flagKey, hookContext.defaultValue);\n }\n}\n"],"names":[],"mappings":";;MAwBa,sBAAA,GAAyB,iBAAiB,CAAC,MAAM;AAC9D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,aAAa;;AAEvB,IAAI,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AACzE,MAAM,OAAO,mCAAmC,CAAC,KAAK,CAAC;AACvD,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACO,MAAM,4BAAsD;AACnE;AACA;AACA;AACA,GAAS,KAAK,CAAC,YAAY,EAAoC,iBAAiB,EAAsC;AACtH,IAAI,2BAA2B,CAAC,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;AACnF,IAAI,oCAAoC,CAAC,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;AAC5F,EAAE;;AAEF;AACA;AACA;AACA,GAAS,KAAK,CAAC,WAAW,EAAoC,MAAM,EAAW,UAAU,EAAoB;AAC7G,IAAI,2BAA2B,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC;AAC9E,IAAI,oCAAoC,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC;AACvF,EAAE;AACF;;;;"}
1
+ {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/openfeature/integration.ts"],"sourcesContent":["/**\n * Sentry integration for capturing OpenFeature feature flag evaluations.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import * as Sentry from \"@sentry/browser\";\n * import { OpenFeature } from \"@openfeature/web-sdk\";\n *\n * Sentry.init(..., integrations: [Sentry.openFeatureIntegration()]);\n * OpenFeature.setProvider(new MyProviderOfChoice());\n * OpenFeature.addHooks(new Sentry.OpenFeatureIntegrationHook());\n * ```\n */\nimport type { Client, Event, EventHint, IntegrationFn } from '@sentry/core/browser';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core/browser';\nimport type { EvaluationDetails, HookContext, HookHints, JsonValue, OpenFeatureHook } from './types';\n\nexport const openFeatureIntegration = defineIntegration(() => {\n return {\n name: 'OpenFeature',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * OpenFeature Hook class implementation.\n */\nexport class OpenFeatureIntegrationHook implements OpenFeatureHook {\n /**\n * Successful evaluation result.\n */\n public after(_hookContext: Readonly<HookContext<JsonValue>>, evaluationDetails: EvaluationDetails<JsonValue>): void {\n _INTERNAL_insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);\n _INTERNAL_addFeatureFlagToActiveSpan(evaluationDetails.flagKey, evaluationDetails.value);\n }\n\n /**\n * On error evaluation result.\n */\n public error(hookContext: Readonly<HookContext<JsonValue>>, _error: unknown, _hookHints?: HookHints): void {\n _INTERNAL_insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);\n _INTERNAL_addFeatureFlagToActiveSpan(hookContext.flagKey, hookContext.defaultValue);\n }\n}\n"],"names":[],"mappings":";;AAwBO,MAAM,sBAAA,GAAyB,kBAAkB,MAAM;AAC5D,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,aAAA;AAAA,IAEN,YAAA,CAAa,KAAA,EAAc,KAAA,EAAkB,OAAA,EAAwB;AACnE,MAAA,OAAO,oCAAoC,KAAK,CAAA;AAAA,IAClD;AAAA,GACF;AACF,CAAC;AAKM,MAAM,0BAAA,CAAsD;AAAA;AAAA;AAAA;AAAA,EAI1D,KAAA,CAAM,cAAgD,iBAAA,EAAuD;AAClH,IAAA,2BAAA,CAA4B,iBAAA,CAAkB,OAAA,EAAS,iBAAA,CAAkB,KAAK,CAAA;AAC9E,IAAA,oCAAA,CAAqC,iBAAA,CAAkB,OAAA,EAAS,iBAAA,CAAkB,KAAK,CAAA;AAAA,EACzF;AAAA;AAAA;AAAA;AAAA,EAKO,KAAA,CAAM,WAAA,EAA+C,MAAA,EAAiB,UAAA,EAA8B;AACzG,IAAA,2BAAA,CAA4B,WAAA,CAAY,OAAA,EAAS,WAAA,CAAY,YAAY,CAAA;AACzE,IAAA,oCAAA,CAAqC,WAAA,CAAY,OAAA,EAAS,WAAA,CAAY,YAAY,CAAA;AAAA,EACpF;AACF;;;;"}
@@ -1,46 +1,21 @@
1
1
  import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan } from '@sentry/core/browser';
2
2
 
3
- /**
4
- * Sentry integration for capturing feature flag evaluations from the Statsig js-client SDK.
5
- *
6
- * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
7
- *
8
- * @example
9
- * ```
10
- * import { StatsigClient } from '@statsig/js-client';
11
- * import * as Sentry from '@sentry/browser';
12
- *
13
- * const statsigClient = new StatsigClient();
14
- *
15
- * Sentry.init({
16
- * dsn: '___PUBLIC_DSN___',
17
- * integrations: [Sentry.statsigIntegration({featureFlagClient: statsigClient})],
18
- * });
19
- *
20
- * await statsigClient.initializeAsync(); // or statsigClient.initializeSync();
21
- *
22
- * const result = statsigClient.checkGate('my-feature-gate');
23
- * Sentry.captureException(new Error('something went wrong'));
24
- * ```
25
- */
26
3
  const statsigIntegration = defineIntegration(
27
4
  ({ featureFlagClient: statsigClient }) => {
28
5
  return {
29
- name: 'Statsig',
30
-
6
+ name: "Statsig",
31
7
  setup(_client) {
32
- statsigClient.on('gate_evaluation', (event) => {
8
+ statsigClient.on("gate_evaluation", (event) => {
33
9
  _INTERNAL_insertFlagToScope(event.gate.name, event.gate.value);
34
10
  _INTERNAL_addFeatureFlagToActiveSpan(event.gate.name, event.gate.value);
35
11
  });
36
12
  },
37
-
38
13
  processEvent(event, _hint, _client) {
39
14
  return _INTERNAL_copyFlagsFromScopeToEvent(event);
40
- },
15
+ }
41
16
  };
42
- },
43
- ) ;
17
+ }
18
+ );
44
19
 
45
20
  export { statsigIntegration };
46
21
  //# sourceMappingURL=integration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/statsig/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core/browser';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core/browser';\nimport type { FeatureGate, StatsigClient } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from the Statsig js-client SDK.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import { StatsigClient } from '@statsig/js-client';\n * import * as Sentry from '@sentry/browser';\n *\n * const statsigClient = new StatsigClient();\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.statsigIntegration({featureFlagClient: statsigClient})],\n * });\n *\n * await statsigClient.initializeAsync(); // or statsigClient.initializeSync();\n *\n * const result = statsigClient.checkGate('my-feature-gate');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const statsigIntegration = defineIntegration(\n ({ featureFlagClient: statsigClient }: { featureFlagClient: StatsigClient }) => {\n return {\n name: 'Statsig',\n\n setup(_client: Client) {\n statsigClient.on('gate_evaluation', (event: { gate: FeatureGate }) => {\n _INTERNAL_insertFlagToScope(event.gate.name, event.gate.value);\n _INTERNAL_addFeatureFlagToActiveSpan(event.gate.name, event.gate.value);\n });\n },\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n },\n) satisfies IntegrationFn;\n"],"names":[],"mappings":";;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAA,GAAqB,iBAAiB;AACnD,EAAE,CAAC,EAAE,iBAAiB,EAAE,aAAA,EAAe,KAA2C;AAClF,IAAI,OAAO;AACX,MAAM,IAAI,EAAE,SAAS;;AAErB,MAAM,KAAK,CAAC,OAAO,EAAU;AAC7B,QAAQ,aAAa,CAAC,EAAE,CAAC,iBAAiB,EAAE,CAAC,KAAK,KAA4B;AAC9E,UAAU,2BAA2B,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACxE,UAAU,oCAAoC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACjF,QAAQ,CAAC,CAAC;AACV,MAAM,CAAC;;AAEP,MAAM,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AAC3E,QAAQ,OAAO,mCAAmC,CAAC,KAAK,CAAC;AACzD,MAAM,CAAC;AACP,KAAK;AACL,EAAE,CAAC;AACH,CAAA;;;;"}
1
+ {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/statsig/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core/browser';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core/browser';\nimport type { FeatureGate, StatsigClient } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from the Statsig js-client SDK.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import { StatsigClient } from '@statsig/js-client';\n * import * as Sentry from '@sentry/browser';\n *\n * const statsigClient = new StatsigClient();\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.statsigIntegration({featureFlagClient: statsigClient})],\n * });\n *\n * await statsigClient.initializeAsync(); // or statsigClient.initializeSync();\n *\n * const result = statsigClient.checkGate('my-feature-gate');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const statsigIntegration = defineIntegration(\n ({ featureFlagClient: statsigClient }: { featureFlagClient: StatsigClient }) => {\n return {\n name: 'Statsig',\n\n setup(_client: Client) {\n statsigClient.on('gate_evaluation', (event: { gate: FeatureGate }) => {\n _INTERNAL_insertFlagToScope(event.gate.name, event.gate.value);\n _INTERNAL_addFeatureFlagToActiveSpan(event.gate.name, event.gate.value);\n });\n },\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n },\n) satisfies IntegrationFn;\n"],"names":[],"mappings":";;AAgCO,MAAM,kBAAA,GAAqB,iBAAA;AAAA,EAChC,CAAC,EAAE,iBAAA,EAAmB,aAAA,EAAc,KAA4C;AAC9E,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,SAAA;AAAA,MAEN,MAAM,OAAA,EAAiB;AACrB,QAAA,aAAA,CAAc,EAAA,CAAG,iBAAA,EAAmB,CAAC,KAAA,KAAiC;AACpE,UAAA,2BAAA,CAA4B,KAAA,CAAM,IAAA,CAAK,IAAA,EAAM,KAAA,CAAM,KAAK,KAAK,CAAA;AAC7D,UAAA,oCAAA,CAAqC,KAAA,CAAM,IAAA,CAAK,IAAA,EAAM,KAAA,CAAM,KAAK,KAAK,CAAA;AAAA,QACxE,CAAC,CAAA;AAAA,MACH,CAAA;AAAA,MAEA,YAAA,CAAa,KAAA,EAAc,KAAA,EAAkB,OAAA,EAAwB;AACnE,QAAA,OAAO,oCAAoC,KAAK,CAAA;AAAA,MAClD;AAAA,KACF;AAAA,EACF;AACF;;;;"}
@@ -1,67 +1,30 @@
1
1
  import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, fill, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan, debug } from '@sentry/core/browser';
2
2
  import { DEBUG_BUILD } from '../../../debug-build.js';
3
3
 
4
- /**
5
- * Sentry integration for capturing feature flag evaluations from the Unleash SDK.
6
- *
7
- * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
8
- *
9
- * @example
10
- * ```
11
- * import { UnleashClient } from 'unleash-proxy-client';
12
- * import * as Sentry from '@sentry/browser';
13
- *
14
- * Sentry.init({
15
- * dsn: '___PUBLIC_DSN___',
16
- * integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
17
- * });
18
- *
19
- * const unleash = new UnleashClient(...);
20
- * unleash.start();
21
- *
22
- * unleash.isEnabled('my-feature');
23
- * Sentry.captureException(new Error('something went wrong'));
24
- * ```
25
- */
26
4
  const unleashIntegration = defineIntegration(
27
5
  ({ featureFlagClientClass: unleashClientClass }) => {
28
6
  return {
29
- name: 'Unleash',
30
-
7
+ name: "Unleash",
31
8
  setupOnce() {
32
- const unleashClientPrototype = unleashClientClass.prototype ;
33
- fill(unleashClientPrototype, 'isEnabled', _wrappedIsEnabled);
9
+ const unleashClientPrototype = unleashClientClass.prototype;
10
+ fill(unleashClientPrototype, "isEnabled", _wrappedIsEnabled);
34
11
  },
35
-
36
12
  processEvent(event, _hint, _client) {
37
13
  return _INTERNAL_copyFlagsFromScopeToEvent(event);
38
- },
14
+ }
39
15
  };
40
- },
41
- ) ;
42
-
43
- /**
44
- * Wraps the UnleashClient.isEnabled method to capture feature flag evaluations. Its only side effect is writing to Sentry scope.
45
- *
46
- * This wrapper is safe for all isEnabled signatures. If the signature does not match (this: UnleashClient, toggleName: string, ...args: unknown[]) => boolean,
47
- * we log an error and return the original result.
48
- *
49
- * @param original - The original method.
50
- * @returns Wrapped method. Results should match the original.
51
- */
52
- function _wrappedIsEnabled(
53
- original,
54
- ) {
55
- return function ( ...args) {
16
+ }
17
+ );
18
+ function _wrappedIsEnabled(original) {
19
+ return function(...args) {
56
20
  const toggleName = args[0];
57
21
  const result = original.apply(this, args);
58
-
59
- if (typeof toggleName === 'string' && typeof result === 'boolean') {
22
+ if (typeof toggleName === "string" && typeof result === "boolean") {
60
23
  _INTERNAL_insertFlagToScope(toggleName, result);
61
24
  _INTERNAL_addFeatureFlagToActiveSpan(toggleName, result);
62
25
  } else if (DEBUG_BUILD) {
63
26
  debug.error(
64
- `[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${toggleName} (${typeof toggleName}), result: ${result} (${typeof result})`,
27
+ `[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${toggleName} (${typeof toggleName}), result: ${result} (${typeof result})`
65
28
  );
66
29
  }
67
30
  return result;
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/unleash/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core/browser';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n debug,\n defineIntegration,\n fill,\n} from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport type { UnleashClient, UnleashClientClass } from './types';\n\ntype UnleashIntegrationOptions = {\n featureFlagClientClass: UnleashClientClass;\n};\n\n/**\n * Sentry integration for capturing feature flag evaluations from the Unleash SDK.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import { UnleashClient } from 'unleash-proxy-client';\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],\n * });\n *\n * const unleash = new UnleashClient(...);\n * unleash.start();\n *\n * unleash.isEnabled('my-feature');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const unleashIntegration = defineIntegration(\n ({ featureFlagClientClass: unleashClientClass }: UnleashIntegrationOptions) => {\n return {\n name: 'Unleash',\n\n setupOnce() {\n const unleashClientPrototype = unleashClientClass.prototype as UnleashClient;\n fill(unleashClientPrototype, 'isEnabled', _wrappedIsEnabled);\n },\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n },\n) satisfies IntegrationFn;\n\n/**\n * Wraps the UnleashClient.isEnabled method to capture feature flag evaluations. Its only side effect is writing to Sentry scope.\n *\n * This wrapper is safe for all isEnabled signatures. If the signature does not match (this: UnleashClient, toggleName: string, ...args: unknown[]) => boolean,\n * we log an error and return the original result.\n *\n * @param original - The original method.\n * @returns Wrapped method. Results should match the original.\n */\nfunction _wrappedIsEnabled(\n original: (this: UnleashClient, ...args: unknown[]) => unknown,\n): (this: UnleashClient, ...args: unknown[]) => unknown {\n return function (this: UnleashClient, ...args: unknown[]): unknown {\n const toggleName = args[0];\n const result = original.apply(this, args);\n\n if (typeof toggleName === 'string' && typeof result === 'boolean') {\n _INTERNAL_insertFlagToScope(toggleName, result);\n _INTERNAL_addFeatureFlagToActiveSpan(toggleName, result);\n } else if (DEBUG_BUILD) {\n debug.error(\n `[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${toggleName} (${typeof toggleName}), result: ${result} (${typeof result})`,\n );\n }\n return result;\n };\n}\n"],"names":[],"mappings":";;;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAA,GAAqB,iBAAiB;AACnD,EAAE,CAAC,EAAE,sBAAsB,EAAE,kBAAA,EAAoB,KAAgC;AACjF,IAAI,OAAO;AACX,MAAM,IAAI,EAAE,SAAS;;AAErB,MAAM,SAAS,GAAG;AAClB,QAAQ,MAAM,sBAAA,GAAyB,kBAAkB,CAAC,SAAA;AAC1D,QAAQ,IAAI,CAAC,sBAAsB,EAAE,WAAW,EAAE,iBAAiB,CAAC;AACpE,MAAM,CAAC;;AAEP,MAAM,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AAC3E,QAAQ,OAAO,mCAAmC,CAAC,KAAK,CAAC;AACzD,MAAM,CAAC;AACP,KAAK;AACL,EAAE,CAAC;AACH,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB;AAC1B,EAAE,QAAQ;AACV,EAAwD;AACxD,EAAE,OAAO,WAA+B,GAAG,IAAI,EAAsB;AACrE,IAAI,MAAM,UAAA,GAAa,IAAI,CAAC,CAAC,CAAC;AAC9B,IAAI,MAAM,MAAA,GAAS,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;;AAE7C,IAAI,IAAI,OAAO,UAAA,KAAe,QAAA,IAAY,OAAO,MAAA,KAAW,SAAS,EAAE;AACvE,MAAM,2BAA2B,CAAC,UAAU,EAAE,MAAM,CAAC;AACrD,MAAM,oCAAoC,CAAC,UAAU,EAAE,MAAM,CAAC;AAC9D,IAAI,CAAA,MAAO,IAAI,WAAW,EAAE;AAC5B,MAAM,KAAK,CAAC,KAAK;AACjB,QAAQ,CAAC,iFAAiF,EAAE,UAAU,CAAC,EAAE,EAAE,OAAO,UAAU,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,MAAM,CAAC,CAAC,CAAC;AACrK,OAAO;AACP,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB,EAAE,CAAC;AACH;;;;"}
1
+ {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/unleash/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core/browser';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n debug,\n defineIntegration,\n fill,\n} from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport type { UnleashClient, UnleashClientClass } from './types';\n\ntype UnleashIntegrationOptions = {\n featureFlagClientClass: UnleashClientClass;\n};\n\n/**\n * Sentry integration for capturing feature flag evaluations from the Unleash SDK.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import { UnleashClient } from 'unleash-proxy-client';\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],\n * });\n *\n * const unleash = new UnleashClient(...);\n * unleash.start();\n *\n * unleash.isEnabled('my-feature');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const unleashIntegration = defineIntegration(\n ({ featureFlagClientClass: unleashClientClass }: UnleashIntegrationOptions) => {\n return {\n name: 'Unleash',\n\n setupOnce() {\n const unleashClientPrototype = unleashClientClass.prototype as UnleashClient;\n fill(unleashClientPrototype, 'isEnabled', _wrappedIsEnabled);\n },\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n },\n) satisfies IntegrationFn;\n\n/**\n * Wraps the UnleashClient.isEnabled method to capture feature flag evaluations. Its only side effect is writing to Sentry scope.\n *\n * This wrapper is safe for all isEnabled signatures. If the signature does not match (this: UnleashClient, toggleName: string, ...args: unknown[]) => boolean,\n * we log an error and return the original result.\n *\n * @param original - The original method.\n * @returns Wrapped method. Results should match the original.\n */\nfunction _wrappedIsEnabled(\n original: (this: UnleashClient, ...args: unknown[]) => unknown,\n): (this: UnleashClient, ...args: unknown[]) => unknown {\n return function (this: UnleashClient, ...args: unknown[]): unknown {\n const toggleName = args[0];\n const result = original.apply(this, args);\n\n if (typeof toggleName === 'string' && typeof result === 'boolean') {\n _INTERNAL_insertFlagToScope(toggleName, result);\n _INTERNAL_addFeatureFlagToActiveSpan(toggleName, result);\n } else if (DEBUG_BUILD) {\n debug.error(\n `[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${toggleName} (${typeof toggleName}), result: ${result} (${typeof result})`,\n );\n }\n return result;\n };\n}\n"],"names":[],"mappings":";;;AAsCO,MAAM,kBAAA,GAAqB,iBAAA;AAAA,EAChC,CAAC,EAAE,sBAAA,EAAwB,kBAAA,EAAmB,KAAiC;AAC7E,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,SAAA;AAAA,MAEN,SAAA,GAAY;AACV,QAAA,MAAM,yBAAyB,kBAAA,CAAmB,SAAA;AAClD,QAAA,IAAA,CAAK,sBAAA,EAAwB,aAAa,iBAAiB,CAAA;AAAA,MAC7D,CAAA;AAAA,MAEA,YAAA,CAAa,KAAA,EAAc,KAAA,EAAkB,OAAA,EAAwB;AACnE,QAAA,OAAO,oCAAoC,KAAK,CAAA;AAAA,MAClD;AAAA,KACF;AAAA,EACF;AACF;AAWA,SAAS,kBACP,QAAA,EACsD;AACtD,EAAA,OAAO,YAAkC,IAAA,EAA0B;AACjE,IAAA,MAAM,UAAA,GAAa,KAAK,CAAC,CAAA;AACzB,IAAA,MAAM,MAAA,GAAS,QAAA,CAAS,KAAA,CAAM,IAAA,EAAM,IAAI,CAAA;AAExC,IAAA,IAAI,OAAO,UAAA,KAAe,QAAA,IAAY,OAAO,WAAW,SAAA,EAAW;AACjE,MAAA,2BAAA,CAA4B,YAAY,MAAM,CAAA;AAC9C,MAAA,oCAAA,CAAqC,YAAY,MAAM,CAAA;AAAA,IACzD,WAAW,WAAA,EAAa;AACtB,MAAA,KAAA,CAAM,KAAA;AAAA,QACJ,CAAA,iFAAA,EAAoF,UAAU,CAAA,EAAA,EAAK,OAAO,UAAU,CAAA,WAAA,EAAc,MAAM,CAAA,EAAA,EAAK,OAAO,MAAM,CAAA,CAAA;AAAA,OAC5J;AAAA,IACF;AACA,IAAA,OAAO,MAAA;AAAA,EACT,CAAA;AACF;;;;"}
@@ -0,0 +1,58 @@
1
+ import { defineIntegration, addFetchEndInstrumentationHandler, addFetchInstrumentationHandler, parseStringToURLObject, stripDataUrlContent, getSanitizedUrlStringFromUrlObject, startInactiveSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_OP } from '@sentry/core';
2
+
3
+ const responseToStreamSpan = /* @__PURE__ */ new WeakMap();
4
+ const responseToFallbackTimeout = /* @__PURE__ */ new WeakMap();
5
+ const STREAM_RESOLVE_FALLBACK_MS = 9e4;
6
+ const STREAMING_CONTENT_TYPES = ["text/event-stream", "application/x-ndjson", "application/stream+json"];
7
+ const fetchStreamPerformanceIntegration = defineIntegration(() => {
8
+ return {
9
+ name: "FetchStreamPerformance",
10
+ setup() {
11
+ addFetchEndInstrumentationHandler((handlerData) => {
12
+ if (handlerData.response) {
13
+ const streamSpan = responseToStreamSpan.get(handlerData.response);
14
+ if (streamSpan && handlerData.endTimestamp) {
15
+ streamSpan.end(handlerData.endTimestamp);
16
+ const fallbackTimeout = responseToFallbackTimeout.get(handlerData.response);
17
+ if (fallbackTimeout) {
18
+ clearTimeout(fallbackTimeout);
19
+ }
20
+ }
21
+ }
22
+ });
23
+ addFetchInstrumentationHandler((handlerData) => {
24
+ if (handlerData.endTimestamp && handlerData.response) {
25
+ const contentType = handlerData.response.headers?.get("content-type") || "";
26
+ if (handlerData.response.headers?.get("content-length") || !STREAMING_CONTENT_TYPES.some((t) => contentType.startsWith(t))) {
27
+ return;
28
+ }
29
+ const url = handlerData.fetchData?.url || "";
30
+ const method = handlerData.fetchData?.method || "GET";
31
+ const parsedUrl = parseStringToURLObject(url);
32
+ const sanitizedUrl = url.startsWith("data:") ? stripDataUrlContent(url) : parsedUrl ? getSanitizedUrlStringFromUrlObject(parsedUrl) : url;
33
+ const streamSpan = startInactiveSpan({
34
+ name: `${method} ${sanitizedUrl}`,
35
+ startTime: handlerData.endTimestamp,
36
+ attributes: {
37
+ url: stripDataUrlContent(url),
38
+ "http.method": method,
39
+ type: "fetch",
40
+ [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "http.client.stream",
41
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.browser.stream"
42
+ }
43
+ });
44
+ responseToStreamSpan.set(handlerData.response, streamSpan);
45
+ const fallbackTimeout = setTimeout(() => {
46
+ if (streamSpan.isRecording()) {
47
+ streamSpan.end();
48
+ }
49
+ }, STREAM_RESOLVE_FALLBACK_MS);
50
+ responseToFallbackTimeout.set(handlerData.response, fallbackTimeout);
51
+ }
52
+ });
53
+ }
54
+ };
55
+ });
56
+
57
+ export { fetchStreamPerformanceIntegration };
58
+ //# sourceMappingURL=fetchStreamPerformance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchStreamPerformance.js","sources":["../../../../../src/integrations/fetchStreamPerformance.ts"],"sourcesContent":["import type { IntegrationFn, Span } from '@sentry/core';\nimport {\n addFetchEndInstrumentationHandler,\n addFetchInstrumentationHandler,\n defineIntegration,\n getSanitizedUrlStringFromUrlObject,\n parseStringToURLObject,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n startInactiveSpan,\n stripDataUrlContent,\n} from '@sentry/core';\n\nconst responseToStreamSpan = new WeakMap<object, Span>();\nconst responseToFallbackTimeout = new WeakMap<object, ReturnType<typeof setTimeout>>();\n\n// Matches the max timeout in `resolveResponse` in packages/core/src/instrument/fetch.ts\nconst STREAM_RESOLVE_FALLBACK_MS = 90_000;\n\nconst STREAMING_CONTENT_TYPES = ['text/event-stream', 'application/x-ndjson', 'application/stream+json'];\n\n/**\n * Tracks streamed fetch response bodies by creating an `http.client.stream` sibling span.\n *\n * The regular `http.client` span ends when response headers arrive. This integration adds\n * a span that starts at header arrival and ends when the body fully resolves:\n *\n * ```\n * --------- pageload --------------------------------\n * -- http.client --\n * -- http.client.stream -------\n * ```\n */\nexport const fetchStreamPerformanceIntegration = defineIntegration(() => {\n return {\n name: 'FetchStreamPerformance',\n\n setup() {\n // End the stream span when the response body finishes resolving\n addFetchEndInstrumentationHandler(handlerData => {\n if (handlerData.response) {\n const streamSpan = responseToStreamSpan.get(handlerData.response);\n if (streamSpan && handlerData.endTimestamp) {\n streamSpan.end(handlerData.endTimestamp);\n\n const fallbackTimeout = responseToFallbackTimeout.get(handlerData.response);\n if (fallbackTimeout) {\n clearTimeout(fallbackTimeout);\n }\n }\n }\n });\n\n addFetchInstrumentationHandler(handlerData => {\n // Only create the stream span once headers have arrived\n if (handlerData.endTimestamp && handlerData.response) {\n // Only create stream spans for responses that are likely streamed:\n // 1. No content-length header (streamed responses don't know the size upfront)\n // 2. Content-type is a known streaming type (avoids false positives on HTTP/2\n // where content-length is often omitted even for regular responses)\n const contentType = handlerData.response.headers?.get('content-type') || '';\n if (\n handlerData.response.headers?.get('content-length') ||\n !STREAMING_CONTENT_TYPES.some(t => contentType.startsWith(t))\n ) {\n return;\n }\n\n const url = handlerData.fetchData?.url || '';\n const method = handlerData.fetchData?.method || 'GET';\n\n const parsedUrl = parseStringToURLObject(url);\n const sanitizedUrl = url.startsWith('data:')\n ? stripDataUrlContent(url)\n : parsedUrl\n ? getSanitizedUrlStringFromUrlObject(parsedUrl)\n : url;\n\n const streamSpan = startInactiveSpan({\n name: `${method} ${sanitizedUrl}`,\n startTime: handlerData.endTimestamp,\n attributes: {\n url: stripDataUrlContent(url),\n 'http.method': method,\n type: 'fetch',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client.stream',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser.stream',\n },\n });\n\n responseToStreamSpan.set(handlerData.response, streamSpan);\n\n // prevent the span from leaking indefinitely if the body never resolves\n const fallbackTimeout = setTimeout(() => {\n if (streamSpan.isRecording()) {\n streamSpan.end();\n }\n }, STREAM_RESOLVE_FALLBACK_MS);\n\n responseToFallbackTimeout.set(handlerData.response, fallbackTimeout);\n }\n });\n },\n };\n}) satisfies IntegrationFn;\n"],"names":[],"mappings":";;AAaA,MAAM,oBAAA,uBAA2B,OAAA,EAAsB;AACvD,MAAM,yBAAA,uBAAgC,OAAA,EAA+C;AAGrF,MAAM,0BAAA,GAA6B,GAAA;AAEnC,MAAM,uBAAA,GAA0B,CAAC,mBAAA,EAAqB,sBAAA,EAAwB,yBAAyB,CAAA;AAchG,MAAM,iCAAA,GAAoC,kBAAkB,MAAM;AACvE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,wBAAA;AAAA,IAEN,KAAA,GAAQ;AAEN,MAAA,iCAAA,CAAkC,CAAA,WAAA,KAAe;AAC/C,QAAA,IAAI,YAAY,QAAA,EAAU;AACxB,UAAA,MAAM,UAAA,GAAa,oBAAA,CAAqB,GAAA,CAAI,WAAA,CAAY,QAAQ,CAAA;AAChE,UAAA,IAAI,UAAA,IAAc,YAAY,YAAA,EAAc;AAC1C,YAAA,UAAA,CAAW,GAAA,CAAI,YAAY,YAAY,CAAA;AAEvC,YAAA,MAAM,eAAA,GAAkB,yBAAA,CAA0B,GAAA,CAAI,WAAA,CAAY,QAAQ,CAAA;AAC1E,YAAA,IAAI,eAAA,EAAiB;AACnB,cAAA,YAAA,CAAa,eAAe,CAAA;AAAA,YAC9B;AAAA,UACF;AAAA,QACF;AAAA,MACF,CAAC,CAAA;AAED,MAAA,8BAAA,CAA+B,CAAA,WAAA,KAAe;AAE5C,QAAA,IAAI,WAAA,CAAY,YAAA,IAAgB,WAAA,CAAY,QAAA,EAAU;AAKpD,UAAA,MAAM,cAAc,WAAA,CAAY,QAAA,CAAS,OAAA,EAAS,GAAA,CAAI,cAAc,CAAA,IAAK,EAAA;AACzE,UAAA,IACE,WAAA,CAAY,QAAA,CAAS,OAAA,EAAS,GAAA,CAAI,gBAAgB,CAAA,IAClD,CAAC,uBAAA,CAAwB,IAAA,CAAK,CAAA,CAAA,KAAK,WAAA,CAAY,UAAA,CAAW,CAAC,CAAC,CAAA,EAC5D;AACA,YAAA;AAAA,UACF;AAEA,UAAA,MAAM,GAAA,GAAM,WAAA,CAAY,SAAA,EAAW,GAAA,IAAO,EAAA;AAC1C,UAAA,MAAM,MAAA,GAAS,WAAA,CAAY,SAAA,EAAW,MAAA,IAAU,KAAA;AAEhD,UAAA,MAAM,SAAA,GAAY,uBAAuB,GAAG,CAAA;AAC5C,UAAA,MAAM,YAAA,GAAe,GAAA,CAAI,UAAA,CAAW,OAAO,CAAA,GACvC,mBAAA,CAAoB,GAAG,CAAA,GACvB,SAAA,GACE,kCAAA,CAAmC,SAAS,CAAA,GAC5C,GAAA;AAEN,UAAA,MAAM,aAAa,iBAAA,CAAkB;AAAA,YACnC,IAAA,EAAM,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,YAAY,CAAA,CAAA;AAAA,YAC/B,WAAW,WAAA,CAAY,YAAA;AAAA,YACvB,UAAA,EAAY;AAAA,cACV,GAAA,EAAK,oBAAoB,GAAG,CAAA;AAAA,cAC5B,aAAA,EAAe,MAAA;AAAA,cACf,IAAA,EAAM,OAAA;AAAA,cACN,CAAC,4BAA4B,GAAG,oBAAA;AAAA,cAChC,CAAC,gCAAgC,GAAG;AAAA;AACtC,WACD,CAAA;AAED,UAAA,oBAAA,CAAqB,GAAA,CAAI,WAAA,CAAY,QAAA,EAAU,UAAU,CAAA;AAGzD,UAAA,MAAM,eAAA,GAAkB,WAAW,MAAM;AACvC,YAAA,IAAI,UAAA,CAAW,aAAY,EAAG;AAC5B,cAAA,UAAA,CAAW,GAAA,EAAI;AAAA,YACjB;AAAA,UACF,GAAG,0BAA0B,CAAA;AAE7B,UAAA,yBAAA,CAA0B,GAAA,CAAI,WAAA,CAAY,QAAA,EAAU,eAAe,CAAA;AAAA,QACrE;AAAA,MACF,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAC;;;;"}