@rudderstack/analytics-js 3.19.0 → 3.20.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [3.20.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.19.0...@rudderstack/analytics-js@3.20.0) (2025-06-11)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `@rudderstack/analytics-js-cookies` updated to version `0.4.26`
10
+ * `@rudderstack/analytics-js-common` updated to version `3.20.0`
11
+ * `@rudderstack/analytics-js-plugins` updated to version `3.10.0`
12
+
13
+ ### Features
14
+
15
+ * add support to dynamically override destinations status ([#2266](https://github.com/rudderlabs/rudder-sdk-js/issues/2266)) ([5af2f22](https://github.com/rudderlabs/rudder-sdk-js/commit/5af2f22ebdcac4eb04d57ecb51efa427607bc849))
16
+ * dynamically clone destinations ([#2276](https://github.com/rudderlabs/rudder-sdk-js/issues/2276)) ([f136454](https://github.com/rudderlabs/rudder-sdk-js/commit/f1364541743b15d240ceed6d8f403c23b6984086))
17
+ * enable destination config override ([#2267](https://github.com/rudderlabs/rudder-sdk-js/issues/2267)) ([c570106](https://github.com/rudderlabs/rudder-sdk-js/commit/c5701065133d3fbddcff9072950ce935ef69e38a))
18
+ * enhance retry headers with RSA-prefixed naming ([#2279](https://github.com/rudderlabs/rudder-sdk-js/issues/2279)) ([c25b2bc](https://github.com/rudderlabs/rudder-sdk-js/commit/c25b2bc5bb4b5b41469065138eef88c2fa21a460))
19
+ * set proper grouping hash for all errors ([#2246](https://github.com/rudderlabs/rudder-sdk-js/issues/2246)) ([430c497](https://github.com/rudderlabs/rudder-sdk-js/commit/430c49782b95bf3e8de1f6a62b442b363208a66b))
20
+
5
21
  ## [3.19.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.18.2...@rudderstack/analytics-js@3.19.0) (2025-06-03)
6
22
 
7
23
  ### Dependency Updates
@@ -280,6 +280,17 @@ type AutoTrackOptions = {
280
280
  options?: ApiOptions;
281
281
  pageLifecycle?: PageLifecycleOptions;
282
282
  };
283
+ /**
284
+ * Represents the source configuration override options for destinations
285
+ */
286
+ type SourceConfigurationOverrideDestination = {
287
+ id: string;
288
+ enabled?: boolean;
289
+ config?: Record<string, any>;
290
+ };
291
+ type SourceConfigurationOverride = {
292
+ destinations: SourceConfigurationOverrideDestination[];
293
+ };
283
294
  /**
284
295
  * Represents the options parameter in the load API
285
296
  */
@@ -327,6 +338,7 @@ type LoadOptions = {
327
338
  useServerSideCookies?: boolean;
328
339
  dataServiceEndpoint?: string;
329
340
  autoTrack?: AutoTrackOptions;
341
+ sourceConfigurationOverride?: SourceConfigurationOverride;
330
342
  };
331
343
 
332
344
  type Address = {
@@ -549,13 +561,25 @@ interface IRudderAnalytics<T = any> {
549
561
  }
550
562
 
551
563
  type SDKError = unknown | Error | ErrorEvent | Event | PromiseRejectionEvent;
564
+ type ErrorInfo = {
565
+ error: SDKError;
566
+ context: string;
567
+ customMessage?: string;
568
+ errorType?: ErrorType;
569
+ groupingHash?: string | SDKError;
570
+ };
552
571
  interface IErrorHandler {
553
572
  httpClient: IHttpClient;
554
573
  logger: ILogger;
555
574
  init(): void;
556
- onError(error: SDKError, context?: string, customMessage?: string, errorType?: string): void;
575
+ onError(errorInfo: ErrorInfo): void;
557
576
  leaveBreadcrumb(breadcrumb: string): void;
558
577
  }
578
+ declare enum ErrorType {
579
+ HANDLEDEXCEPTION = "handledException",
580
+ UNHANDLEDEXCEPTION = "unhandledException",
581
+ UNHANDLEDREJECTION = "unhandledPromiseRejection"
582
+ }
559
583
 
560
584
  interface IRequestConfig {
561
585
  url: string;
@@ -566,6 +590,7 @@ interface IRequestConfig {
566
590
  type ResponseDetails = {
567
591
  response: string;
568
592
  error?: Error;
593
+ timedOut?: boolean;
569
594
  xhr?: XMLHttpRequest;
570
595
  options: IXHRRequestOptions;
571
596
  };
@@ -599,13 +624,12 @@ interface IHttpClient {
599
624
  interface IExternalSourceLoadConfig {
600
625
  url: string;
601
626
  id: string;
602
- callback?(id?: string): unknown;
627
+ callback?(id: string, error?: SDKError): void;
603
628
  async?: boolean;
604
629
  timeout?: number;
605
630
  extraAttributes?: Record<string, string>;
606
631
  }
607
632
  interface IExternalSrcLoader {
608
- errorHandler: IErrorHandler;
609
633
  logger: ILogger;
610
634
  timeout: number;
611
635
  loadJSFile(config: IExternalSourceLoadConfig): void;
@@ -776,7 +800,7 @@ declare class Store implements IStore {
776
800
  /**
777
801
  * Handle errors
778
802
  */
779
- onError(error: unknown): void;
803
+ onError(error: unknown, customMessage?: string, groupingHash?: string): void;
780
804
  }
781
805
  //# sourceMappingURL=Store.d.ts.map
782
806
 
@@ -877,7 +901,6 @@ type ConfigResponseDestinationItem = {
877
901
  propagateEventsUntransformedOnError: boolean;
878
902
  config: DestinationConfig;
879
903
  updatedAt: string;
880
- deleted: boolean;
881
904
  destinationDefinition: DestinationDefinition;
882
905
  enabled: boolean;
883
906
  id: string;
@@ -280,6 +280,17 @@ type AutoTrackOptions = {
280
280
  options?: ApiOptions;
281
281
  pageLifecycle?: PageLifecycleOptions;
282
282
  };
283
+ /**
284
+ * Represents the source configuration override options for destinations
285
+ */
286
+ type SourceConfigurationOverrideDestination = {
287
+ id: string;
288
+ enabled?: boolean;
289
+ config?: Record<string, any>;
290
+ };
291
+ type SourceConfigurationOverride = {
292
+ destinations: SourceConfigurationOverrideDestination[];
293
+ };
283
294
  /**
284
295
  * Represents the options parameter in the load API
285
296
  */
@@ -327,6 +338,7 @@ type LoadOptions = {
327
338
  useServerSideCookies?: boolean;
328
339
  dataServiceEndpoint?: string;
329
340
  autoTrack?: AutoTrackOptions;
341
+ sourceConfigurationOverride?: SourceConfigurationOverride;
330
342
  };
331
343
 
332
344
  type Address = {
@@ -549,13 +561,25 @@ interface IRudderAnalytics<T = any> {
549
561
  }
550
562
 
551
563
  type SDKError = unknown | Error | ErrorEvent | Event | PromiseRejectionEvent;
564
+ type ErrorInfo = {
565
+ error: SDKError;
566
+ context: string;
567
+ customMessage?: string;
568
+ errorType?: ErrorType;
569
+ groupingHash?: string | SDKError;
570
+ };
552
571
  interface IErrorHandler {
553
572
  httpClient: IHttpClient;
554
573
  logger: ILogger;
555
574
  init(): void;
556
- onError(error: SDKError, context?: string, customMessage?: string, errorType?: string): void;
575
+ onError(errorInfo: ErrorInfo): void;
557
576
  leaveBreadcrumb(breadcrumb: string): void;
558
577
  }
578
+ declare enum ErrorType {
579
+ HANDLEDEXCEPTION = "handledException",
580
+ UNHANDLEDEXCEPTION = "unhandledException",
581
+ UNHANDLEDREJECTION = "unhandledPromiseRejection"
582
+ }
559
583
 
560
584
  interface IRequestConfig {
561
585
  url: string;
@@ -566,6 +590,7 @@ interface IRequestConfig {
566
590
  type ResponseDetails = {
567
591
  response: string;
568
592
  error?: Error;
593
+ timedOut?: boolean;
569
594
  xhr?: XMLHttpRequest;
570
595
  options: IXHRRequestOptions;
571
596
  };
@@ -599,13 +624,12 @@ interface IHttpClient {
599
624
  interface IExternalSourceLoadConfig {
600
625
  url: string;
601
626
  id: string;
602
- callback?(id?: string): unknown;
627
+ callback?(id: string, error?: SDKError): void;
603
628
  async?: boolean;
604
629
  timeout?: number;
605
630
  extraAttributes?: Record<string, string>;
606
631
  }
607
632
  interface IExternalSrcLoader {
608
- errorHandler: IErrorHandler;
609
633
  logger: ILogger;
610
634
  timeout: number;
611
635
  loadJSFile(config: IExternalSourceLoadConfig): void;
@@ -776,7 +800,7 @@ declare class Store implements IStore {
776
800
  /**
777
801
  * Handle errors
778
802
  */
779
- onError(error: unknown): void;
803
+ onError(error: unknown, customMessage?: string, groupingHash?: string): void;
780
804
  }
781
805
  //# sourceMappingURL=Store.d.ts.map
782
806
 
@@ -877,7 +901,6 @@ type ConfigResponseDestinationItem = {
877
901
  propagateEventsUntransformedOnError: boolean;
878
902
  config: DestinationConfig;
879
903
  updatedAt: string;
880
- deleted: boolean;
881
904
  destinationDefinition: DestinationDefinition;
882
905
  enabled: boolean;
883
906
  id: string;