posthog-js 1.167.1 → 1.168.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 (49) hide show
  1. package/dist/all-external-dependencies.js +2 -2
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.js +2 -2
  4. package/dist/array.full.js.map +1 -1
  5. package/dist/array.full.no-external.js +2 -2
  6. package/dist/array.full.no-external.js.map +1 -1
  7. package/dist/array.js +1 -1
  8. package/dist/array.js.map +1 -1
  9. package/dist/array.no-external.js +1 -1
  10. package/dist/array.no-external.js.map +1 -1
  11. package/dist/exception-autocapture.js +1 -1
  12. package/dist/exception-autocapture.js.map +1 -1
  13. package/dist/external-scripts-loader.js.map +1 -1
  14. package/dist/lib/src/extensions/exception-autocapture/error-conversion.d.ts +36 -2
  15. package/dist/lib/src/types.d.ts +8 -17
  16. package/dist/lib/src/utils/globals.d.ts +3 -2
  17. package/dist/main.js +1 -1
  18. package/dist/main.js.map +1 -1
  19. package/dist/module.d.ts +9 -18
  20. package/dist/module.full.d.ts +9 -18
  21. package/dist/module.full.js +2 -2
  22. package/dist/module.full.js.map +1 -1
  23. package/dist/module.full.no-external.d.ts +9 -18
  24. package/dist/module.full.no-external.js +2 -2
  25. package/dist/module.full.no-external.js.map +1 -1
  26. package/dist/module.js +1 -1
  27. package/dist/module.js.map +1 -1
  28. package/dist/module.no-external.d.ts +9 -18
  29. package/dist/module.no-external.js +1 -1
  30. package/dist/module.no-external.js.map +1 -1
  31. package/dist/recorder-v2.js.map +1 -1
  32. package/dist/recorder.js.map +1 -1
  33. package/dist/surveys-preview.js.map +1 -1
  34. package/dist/surveys.js.map +1 -1
  35. package/dist/tracing-headers.js.map +1 -1
  36. package/dist/web-vitals.js.map +1 -1
  37. package/lib/package.json +1 -1
  38. package/lib/src/extensions/exception-autocapture/error-conversion.d.ts +36 -2
  39. package/lib/src/extensions/exception-autocapture/error-conversion.js +104 -65
  40. package/lib/src/extensions/exception-autocapture/error-conversion.js.map +1 -1
  41. package/lib/src/extensions/sentry-integration.js +1 -0
  42. package/lib/src/extensions/sentry-integration.js.map +1 -1
  43. package/lib/src/posthog-core.js +10 -1
  44. package/lib/src/posthog-core.js.map +1 -1
  45. package/lib/src/types.d.ts +8 -17
  46. package/lib/src/types.js.map +1 -1
  47. package/lib/src/utils/globals.d.ts +3 -2
  48. package/lib/src/utils/globals.js.map +1 -1
  49. package/package.json +1 -1
package/dist/module.d.ts CHANGED
@@ -507,25 +507,16 @@ type ErrorEventArgs = [
507
507
  colno?: number | undefined,
508
508
  error?: Error | undefined
509
509
  ];
510
+ type ErrorMetadata = {
511
+ handled?: boolean;
512
+ synthetic?: boolean;
513
+ overrideExceptionType?: string;
514
+ overrideExceptionMessage?: string;
515
+ defaultExceptionType?: string;
516
+ defaultExceptionMessage?: string;
517
+ };
510
518
  declare const severityLevels: readonly ["fatal", "error", "warning", "log", "info", "debug"];
511
519
  declare type SeverityLevel = typeof severityLevels[number];
512
- interface ErrorProperties {
513
- $exception_type: string;
514
- $exception_message: string;
515
- $exception_level: SeverityLevel;
516
- $exception_source?: string;
517
- $exception_lineno?: number;
518
- $exception_colno?: number;
519
- $exception_DOMException_code?: string;
520
- $exception_is_synthetic?: boolean;
521
- $exception_stack_trace_raw?: string;
522
- $exception_handled?: boolean;
523
- $exception_personURL?: string;
524
- }
525
- interface ErrorConversions {
526
- errorToProperties: (args: ErrorEventArgs) => ErrorProperties;
527
- unhandledRejectionToProperties: (args: [ev: PromiseRejectionEvent]) => ErrorProperties;
528
- }
529
520
 
530
521
  /**
531
522
  * PostHog Persistence Object
@@ -2104,4 +2095,4 @@ declare class PostHog {
2104
2095
 
2105
2096
  declare const posthog: PostHog;
2106
2097
 
2107
- export { type ActionStepStringMatching, type ActionStepType, type ActionType, type AutocaptureCompatibleElement, type AutocaptureConfig, type BasicSurveyQuestion, type BootstrapConfig, type Breaker, type CaptureOptions, type CaptureResult, type CapturedNetworkRequest, Compression, type DecideResponse, type DomAutocaptureEvents, type EarlyAccessFeature, type EarlyAccessFeatureCallback, type EarlyAccessFeatureResponse, type ErrorConversions, type ErrorEventArgs, type ErrorProperties, type EventHandler, type FeatureFlagsCallback, type FlagVariant, type Headers, type HeatmapConfig, type InitiatorType, type IsFeatureEnabledOptions, type JsonRecord, type JsonType, type LinkSurveyQuestion, type MultipleSurveyQuestion, type NetworkRecordOptions, type NetworkRequest, type OptInOutCapturingOptions, type PerformanceCaptureConfig, type PersistentStore, PostHog, type PostHogConfig, type Properties, type Property, type QueuedRequestOptions, type RatingSurveyQuestion, type RequestCallback, type RequestOptions, type RequestResponse, type RetriableRequestOptions, type SessionIdChangedCallback, type SessionRecordingOptions, type SeverityLevel, type SnippetArrayItem, type SupportedWebVitalsMetrics, type Survey, type SurveyAppearance, type SurveyCallback, type SurveyElement, type SurveyQuestion, SurveyQuestionBranchingType, type SurveyQuestionDescriptionContentType, SurveyQuestionType, type SurveyRenderReason, type SurveyResponse, SurveyType, type SurveyUrlMatchType, type ToolbarParams, type ToolbarSource, type ToolbarUserIntent, type ToolbarVersion, posthog as default, posthog, severityLevels };
2098
+ export { type ActionStepStringMatching, type ActionStepType, type ActionType, type AutocaptureCompatibleElement, type AutocaptureConfig, type BasicSurveyQuestion, type BootstrapConfig, type Breaker, type CaptureOptions, type CaptureResult, type CapturedNetworkRequest, Compression, type DecideResponse, type DomAutocaptureEvents, type EarlyAccessFeature, type EarlyAccessFeatureCallback, type EarlyAccessFeatureResponse, type ErrorEventArgs, type ErrorMetadata, type EventHandler, type FeatureFlagsCallback, type FlagVariant, type Headers, type HeatmapConfig, type InitiatorType, type IsFeatureEnabledOptions, type JsonRecord, type JsonType, type LinkSurveyQuestion, type MultipleSurveyQuestion, type NetworkRecordOptions, type NetworkRequest, type OptInOutCapturingOptions, type PerformanceCaptureConfig, type PersistentStore, PostHog, type PostHogConfig, type Properties, type Property, type QueuedRequestOptions, type RatingSurveyQuestion, type RequestCallback, type RequestOptions, type RequestResponse, type RetriableRequestOptions, type SessionIdChangedCallback, type SessionRecordingOptions, type SeverityLevel, type SnippetArrayItem, type SupportedWebVitalsMetrics, type Survey, type SurveyAppearance, type SurveyCallback, type SurveyElement, type SurveyQuestion, SurveyQuestionBranchingType, type SurveyQuestionDescriptionContentType, SurveyQuestionType, type SurveyRenderReason, type SurveyResponse, SurveyType, type SurveyUrlMatchType, type ToolbarParams, type ToolbarSource, type ToolbarUserIntent, type ToolbarVersion, posthog as default, posthog, severityLevels };
@@ -2082,26 +2082,17 @@ type ErrorEventArgs = [
2082
2082
  colno?: number | undefined,
2083
2083
  error?: Error | undefined
2084
2084
  ];
2085
+ type ErrorMetadata = {
2086
+ handled?: boolean;
2087
+ synthetic?: boolean;
2088
+ overrideExceptionType?: string;
2089
+ overrideExceptionMessage?: string;
2090
+ defaultExceptionType?: string;
2091
+ defaultExceptionMessage?: string;
2092
+ };
2085
2093
  declare const severityLevels: readonly ["fatal", "error", "warning", "log", "info", "debug"];
2086
2094
  declare type SeverityLevel = typeof severityLevels[number];
2087
- interface ErrorProperties {
2088
- $exception_type: string;
2089
- $exception_message: string;
2090
- $exception_level: SeverityLevel;
2091
- $exception_source?: string;
2092
- $exception_lineno?: number;
2093
- $exception_colno?: number;
2094
- $exception_DOMException_code?: string;
2095
- $exception_is_synthetic?: boolean;
2096
- $exception_stack_trace_raw?: string;
2097
- $exception_handled?: boolean;
2098
- $exception_personURL?: string;
2099
- }
2100
- interface ErrorConversions {
2101
- errorToProperties: (args: ErrorEventArgs) => ErrorProperties;
2102
- unhandledRejectionToProperties: (args: [ev: PromiseRejectionEvent]) => ErrorProperties;
2103
- }
2104
2095
 
2105
2096
  declare const posthog: PostHog;
2106
2097
 
2107
- export { type ActionStepStringMatching, type ActionStepType, type ActionType, type AutocaptureCompatibleElement, type AutocaptureConfig, type BasicSurveyQuestion, type BootstrapConfig, type Breaker, type CaptureOptions, type CaptureResult, type CapturedNetworkRequest, Compression, type DecideResponse, type DomAutocaptureEvents, type EarlyAccessFeature, type EarlyAccessFeatureCallback, type EarlyAccessFeatureResponse, type ErrorConversions, type ErrorEventArgs, type ErrorProperties, type EventHandler, type FeatureFlagsCallback, type FlagVariant, type Headers, type HeatmapConfig, type InitiatorType, type IsFeatureEnabledOptions, type JsonRecord, type JsonType, type LinkSurveyQuestion, type MultipleSurveyQuestion, type NetworkRecordOptions, type NetworkRequest, type OptInOutCapturingOptions, type PerformanceCaptureConfig, type PersistentStore, PostHog, type PostHogConfig, type Properties, type Property, type QueuedRequestOptions, type RatingSurveyQuestion, type RequestCallback, type RequestOptions, type RequestResponse, type RetriableRequestOptions, type SessionIdChangedCallback, type SessionRecordingOptions, type SeverityLevel, type SnippetArrayItem, type SupportedWebVitalsMetrics, type Survey, type SurveyAppearance, type SurveyCallback, type SurveyElement, type SurveyQuestion, SurveyQuestionBranchingType, type SurveyQuestionDescriptionContentType, SurveyQuestionType, type SurveyRenderReason, type SurveyResponse, SurveyType, type SurveyUrlMatchType, type ToolbarParams, type ToolbarSource, type ToolbarUserIntent, type ToolbarVersion, posthog as default, posthog, severityLevels };
2098
+ export { type ActionStepStringMatching, type ActionStepType, type ActionType, type AutocaptureCompatibleElement, type AutocaptureConfig, type BasicSurveyQuestion, type BootstrapConfig, type Breaker, type CaptureOptions, type CaptureResult, type CapturedNetworkRequest, Compression, type DecideResponse, type DomAutocaptureEvents, type EarlyAccessFeature, type EarlyAccessFeatureCallback, type EarlyAccessFeatureResponse, type ErrorEventArgs, type ErrorMetadata, type EventHandler, type FeatureFlagsCallback, type FlagVariant, type Headers, type HeatmapConfig, type InitiatorType, type IsFeatureEnabledOptions, type JsonRecord, type JsonType, type LinkSurveyQuestion, type MultipleSurveyQuestion, type NetworkRecordOptions, type NetworkRequest, type OptInOutCapturingOptions, type PerformanceCaptureConfig, type PersistentStore, PostHog, type PostHogConfig, type Properties, type Property, type QueuedRequestOptions, type RatingSurveyQuestion, type RequestCallback, type RequestOptions, type RequestResponse, type RetriableRequestOptions, type SessionIdChangedCallback, type SessionRecordingOptions, type SeverityLevel, type SnippetArrayItem, type SupportedWebVitalsMetrics, type Survey, type SurveyAppearance, type SurveyCallback, type SurveyElement, type SurveyQuestion, SurveyQuestionBranchingType, type SurveyQuestionDescriptionContentType, SurveyQuestionType, type SurveyRenderReason, type SurveyResponse, SurveyType, type SurveyUrlMatchType, type ToolbarParams, type ToolbarSource, type ToolbarUserIntent, type ToolbarVersion, posthog as default, posthog, severityLevels };