@rudderstack/analytics-js 3.12.0 → 3.14.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +19 -0
- package/dist/npm/index.d.cts +209 -71
- package/dist/npm/index.d.mts +209 -71
- package/dist/npm/legacy/bundled/cjs/index.cjs +216 -309
- package/dist/npm/legacy/bundled/esm/index.mjs +216 -309
- package/dist/npm/legacy/bundled/umd/index.js +216 -309
- package/dist/npm/legacy/cjs/index.cjs +216 -309
- package/dist/npm/legacy/content-script/cjs/index.cjs +216 -284
- package/dist/npm/legacy/content-script/esm/index.mjs +216 -284
- package/dist/npm/legacy/content-script/umd/index.js +216 -284
- package/dist/npm/legacy/esm/index.mjs +216 -309
- package/dist/npm/legacy/umd/index.js +216 -309
- package/dist/npm/modern/bundled/cjs/index.cjs +217 -308
- package/dist/npm/modern/bundled/esm/index.mjs +217 -308
- package/dist/npm/modern/bundled/umd/index.js +217 -308
- package/dist/npm/modern/cjs/index.cjs +209 -178
- package/dist/npm/modern/content-script/cjs/index.cjs +217 -283
- package/dist/npm/modern/content-script/esm/index.mjs +217 -283
- package/dist/npm/modern/content-script/umd/index.js +217 -283
- package/dist/npm/modern/esm/index.mjs +209 -178
- package/dist/npm/modern/umd/index.js +209 -178
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,25 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [3.14.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.13.0...@rudderstack/analytics-js@3.14.0) (2025-01-31)
|
6
|
+
|
7
|
+
### Dependency Updates
|
8
|
+
|
9
|
+
* `@rudderstack/analytics-js-cookies` updated to version `0.4.20`
|
10
|
+
* `@rudderstack/analytics-js-common` updated to version `3.16.0`
|
11
|
+
* `@rudderstack/analytics-js-plugins` updated to version `3.7.0`
|
12
|
+
|
13
|
+
### Features
|
14
|
+
|
15
|
+
* move error reporting functionality to the core module ([#2011](https://github.com/rudderlabs/rudder-sdk-js/issues/2011)) ([78c50c7](https://github.com/rudderlabs/rudder-sdk-js/commit/78c50c7a6e4169560f3182be93148f4512d313ca)), closes [#2001](https://github.com/rudderlabs/rudder-sdk-js/issues/2001) [#2002](https://github.com/rudderlabs/rudder-sdk-js/issues/2002) [#2005](https://github.com/rudderlabs/rudder-sdk-js/issues/2005) [#2006](https://github.com/rudderlabs/rudder-sdk-js/issues/2006) [#2007](https://github.com/rudderlabs/rudder-sdk-js/issues/2007)
|
16
|
+
|
17
|
+
## [3.13.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.12.0...@rudderstack/analytics-js@3.13.0) (2025-01-28)
|
18
|
+
|
19
|
+
|
20
|
+
### Features
|
21
|
+
|
22
|
+
* lock plugins and integrations versions for npm package ([#2020](https://github.com/rudderlabs/rudder-sdk-js/issues/2020)) ([447e524](https://github.com/rudderlabs/rudder-sdk-js/commit/447e524dd1ee5782e6d7a8e834c03c57ebf3c196))
|
23
|
+
|
5
24
|
## [3.12.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.11.17...@rudderstack/analytics-js@3.12.0) (2025-01-24)
|
6
25
|
|
7
26
|
### Dependency Updates
|
package/dist/npm/index.d.cts
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
import { Event } from '@bugsnag/js';
|
2
|
+
|
1
3
|
type LoggerProvider$1 = Record<Exclude<Lowercase<LogLevel>, Lowercase<'NONE'>>, (...data: any[]) => void>;
|
2
4
|
interface ILogger {
|
3
5
|
minLogLevel: number;
|
@@ -125,9 +127,20 @@ interface IPluginsManager {
|
|
125
127
|
invokeSingle<T = any>(extPoint?: string, ...args: any[]): Nullable<T>;
|
126
128
|
register(plugins: ExtensionPlugin[]): void;
|
127
129
|
}
|
128
|
-
type PluginName = 'BeaconQueue' | '
|
130
|
+
type PluginName = 'BeaconQueue' | 'CustomConsentManager' | 'DeviceModeDestinations' | 'DeviceModeTransformation' | 'ExternalAnonymousId' | 'GoogleLinker' | 'IubendaConsentManager' | 'KetchConsentManager' | 'NativeDestinationQueue' | 'OneTrustConsentManager' | 'StorageEncryption' | 'StorageEncryptionLegacy' | 'StorageMigrator' | 'XhrQueue';
|
129
131
|
|
132
|
+
type OneTrustCookieCategory = {
|
133
|
+
oneTrustCookieCategory: string;
|
134
|
+
};
|
135
|
+
type ConsentManagementMetadata = {
|
136
|
+
providers: ConsentManagementProviderMetadata[];
|
137
|
+
};
|
138
|
+
type ConsentManagementProviderMetadata = {
|
139
|
+
provider: ConsentManagementProvider;
|
140
|
+
resolutionStrategy: ConsentResolutionStrategy;
|
141
|
+
};
|
130
142
|
type ConsentManagementProvider = 'iubenda' | 'oneTrust' | 'ketch' | 'custom';
|
143
|
+
type ConsentResolutionStrategy = 'and' | 'or';
|
131
144
|
type Consents = string[];
|
132
145
|
type ConsentManagementOptions = {
|
133
146
|
enabled?: boolean;
|
@@ -135,6 +148,12 @@ type ConsentManagementOptions = {
|
|
135
148
|
allowedConsentIds?: Consents;
|
136
149
|
deniedConsentIds?: Consents;
|
137
150
|
};
|
151
|
+
type KetchConsentPurpose = {
|
152
|
+
purpose: string;
|
153
|
+
};
|
154
|
+
type IubendaConsentPurpose = {
|
155
|
+
purpose: string;
|
156
|
+
};
|
138
157
|
|
139
158
|
type UserSessionKey = 'userId' | 'userTraits' | 'anonymousId' | 'groupId' | 'groupTraits' | 'initialReferrer' | 'initialReferringDomain' | 'sessionInfo' | 'authToken';
|
140
159
|
|
@@ -179,6 +198,15 @@ type SessionOpts = {
|
|
179
198
|
autoTrack?: boolean;
|
180
199
|
timeout?: number;
|
181
200
|
};
|
201
|
+
type EventMapping = {
|
202
|
+
from: string;
|
203
|
+
to: string;
|
204
|
+
};
|
205
|
+
type Conversion = {
|
206
|
+
conversionLabel: string;
|
207
|
+
name: string;
|
208
|
+
};
|
209
|
+
type EventFilteringOption = 'disable' | 'whitelistedEvents' | 'blacklistedEvents';
|
182
210
|
/**
|
183
211
|
* Represents the beacon queue options parameter in loadOptions type
|
184
212
|
*/
|
@@ -521,61 +549,13 @@ type RudderAnalyticsPreloader = {
|
|
521
549
|
[index: string]: (...args: any[]) => any;
|
522
550
|
};
|
523
551
|
|
524
|
-
/**
|
525
|
-
* A buffer queue to serve as a store for any type of data
|
526
|
-
*/
|
527
|
-
declare class BufferQueue<T = any> {
|
528
|
-
items: T[];
|
529
|
-
constructor();
|
530
|
-
enqueue(item: T): void;
|
531
|
-
dequeue(): Nullable<T> | undefined;
|
532
|
-
isEmpty(): boolean;
|
533
|
-
size(): number;
|
534
|
-
clear(): void;
|
535
|
-
}
|
536
|
-
//# sourceMappingURL=BufferQueue.d.ts.map
|
537
|
-
|
538
|
-
interface IExternalSourceLoadConfig {
|
539
|
-
url: string;
|
540
|
-
id: string;
|
541
|
-
callback?(id?: string): unknown;
|
542
|
-
async?: boolean;
|
543
|
-
timeout?: number;
|
544
|
-
extraAttributes?: Record<string, string>;
|
545
|
-
}
|
546
|
-
interface IExternalSrcLoader {
|
547
|
-
errorHandler?: {
|
548
|
-
onError(error: unknown, context?: string, customMessage?: string, shouldAlwaysThrow?: boolean): void;
|
549
|
-
leaveBreadcrumb(breadcrumb: string): void;
|
550
|
-
notifyError(error: Error, errorState: ErrorState): void;
|
551
|
-
};
|
552
|
-
logger?: ILogger;
|
553
|
-
timeout: number;
|
554
|
-
loadJSFile(config: IExternalSourceLoadConfig): void;
|
555
|
-
}
|
556
|
-
|
557
552
|
type SDKError = unknown | Error | ErrorEvent | Event | PromiseRejectionEvent;
|
558
553
|
interface IErrorHandler {
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
init(httpClient: IHttpClient, externalSrcLoader: IExternalSrcLoader): void;
|
563
|
-
onError(error: SDKError, context?: string, customMessage?: string, shouldAlwaysThrow?: boolean, errorType?: string): void;
|
554
|
+
httpClient: IHttpClient;
|
555
|
+
logger: ILogger;
|
556
|
+
onError(error: SDKError, context?: string, customMessage?: string, errorType?: string): void;
|
564
557
|
leaveBreadcrumb(breadcrumb: string): void;
|
565
|
-
notifyError(error: Error, errorState: ErrorState): void;
|
566
|
-
attachErrorListeners(): void;
|
567
558
|
}
|
568
|
-
type ErrorState = {
|
569
|
-
severity: string;
|
570
|
-
unhandled: boolean;
|
571
|
-
severityReason: {
|
572
|
-
type: string;
|
573
|
-
};
|
574
|
-
};
|
575
|
-
type PreLoadErrorData = {
|
576
|
-
error: SDKError;
|
577
|
-
errorState: ErrorState;
|
578
|
-
};
|
579
559
|
|
580
560
|
interface IRequestConfig {
|
581
561
|
url: string;
|
@@ -604,9 +584,8 @@ interface IXHRRequestOptions {
|
|
604
584
|
type HTTPClientMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
605
585
|
interface IHttpClient {
|
606
586
|
errorHandler?: IErrorHandler;
|
607
|
-
logger
|
587
|
+
logger: ILogger;
|
608
588
|
basicAuthHeader?: string;
|
609
|
-
hasErrorHandler: boolean;
|
610
589
|
getData<T = any>(config: IRequestConfig): Promise<{
|
611
590
|
data: T | string | undefined;
|
612
591
|
details?: ResponseDetails;
|
@@ -614,6 +593,22 @@ interface IHttpClient {
|
|
614
593
|
getAsyncData<T = any>(config: IAsyncRequestConfig<T>): void;
|
615
594
|
setAuthHeader(value: string, noBto?: boolean): void;
|
616
595
|
resetAuthHeader(): void;
|
596
|
+
init(errorHandler: IErrorHandler): void;
|
597
|
+
}
|
598
|
+
|
599
|
+
interface IExternalSourceLoadConfig {
|
600
|
+
url: string;
|
601
|
+
id: string;
|
602
|
+
callback?(id?: string): unknown;
|
603
|
+
async?: boolean;
|
604
|
+
timeout?: number;
|
605
|
+
extraAttributes?: Record<string, string>;
|
606
|
+
}
|
607
|
+
interface IExternalSrcLoader {
|
608
|
+
errorHandler: IErrorHandler;
|
609
|
+
logger: ILogger;
|
610
|
+
timeout: number;
|
611
|
+
loadJSFile(config: IExternalSourceLoadConfig): void;
|
617
612
|
}
|
618
613
|
|
619
614
|
type StoreId = string;
|
@@ -623,15 +618,15 @@ interface IStoreConfig {
|
|
623
618
|
isEncrypted?: boolean;
|
624
619
|
validKeys?: Record<string, string>;
|
625
620
|
noCompoundKey?: boolean;
|
626
|
-
errorHandler
|
627
|
-
logger
|
621
|
+
errorHandler: IErrorHandler;
|
622
|
+
logger: ILogger;
|
628
623
|
type?: StorageType;
|
629
624
|
}
|
630
625
|
interface IStoreManager {
|
631
626
|
stores?: Record<StoreId, IStore>;
|
632
627
|
isInitialized?: boolean;
|
633
|
-
errorHandler
|
634
|
-
logger
|
628
|
+
errorHandler: IErrorHandler;
|
629
|
+
logger: ILogger;
|
635
630
|
init(): void;
|
636
631
|
initializeStorageState(): void;
|
637
632
|
setStore(storeConfig: IStoreConfig): IStore;
|
@@ -646,9 +641,9 @@ interface IStore {
|
|
646
641
|
originalEngine: IStorage;
|
647
642
|
noKeyValidation?: boolean;
|
648
643
|
noCompoundKey?: boolean;
|
649
|
-
errorHandler
|
650
|
-
logger
|
651
|
-
pluginsManager
|
644
|
+
errorHandler: IErrorHandler;
|
645
|
+
logger: ILogger;
|
646
|
+
pluginsManager: IPluginsManager;
|
652
647
|
createValidKey(key: string): string | undefined;
|
653
648
|
swapQueueStoreToInMemoryEngine(): void;
|
654
649
|
set(key: string, value: any): void;
|
@@ -712,6 +707,20 @@ type GroupCallOptions = {
|
|
712
707
|
callback?: ApiCallback;
|
713
708
|
};
|
714
709
|
|
710
|
+
/**
|
711
|
+
* A buffer queue to serve as a store for any type of data
|
712
|
+
*/
|
713
|
+
declare class BufferQueue<T = any> {
|
714
|
+
items: T[];
|
715
|
+
constructor();
|
716
|
+
enqueue(item: T): void;
|
717
|
+
dequeue(): Nullable<T> | undefined;
|
718
|
+
isEmpty(): boolean;
|
719
|
+
size(): number;
|
720
|
+
clear(): void;
|
721
|
+
}
|
722
|
+
//# sourceMappingURL=BufferQueue.d.ts.map
|
723
|
+
|
715
724
|
/**
|
716
725
|
* Store Implementation with dedicated storage
|
717
726
|
*/
|
@@ -724,11 +733,10 @@ declare class Store implements IStore {
|
|
724
733
|
originalEngine: IStorage;
|
725
734
|
noKeyValidation?: boolean;
|
726
735
|
noCompoundKey?: boolean;
|
727
|
-
errorHandler
|
728
|
-
|
729
|
-
|
730
|
-
pluginsManager
|
731
|
-
constructor(config: IStoreConfig, engine?: IStorage, pluginsManager?: IPluginsManager);
|
736
|
+
errorHandler: IErrorHandler;
|
737
|
+
logger: ILogger;
|
738
|
+
pluginsManager: IPluginsManager;
|
739
|
+
constructor(config: IStoreConfig, engine: IStorage, pluginsManager: IPluginsManager);
|
732
740
|
/**
|
733
741
|
* Ensure the key is valid and with correct format
|
734
742
|
*/
|
@@ -794,13 +802,142 @@ interface IUserSessionManager {
|
|
794
802
|
setAuthToken(token: Nullable<string>): void;
|
795
803
|
}
|
796
804
|
|
805
|
+
type DestinationConnectionMode = 'hybrid' | 'cloud' | 'device';
|
806
|
+
type DestinationEvent = {
|
807
|
+
eventName: string;
|
808
|
+
};
|
809
|
+
type ConsentsConfig = {
|
810
|
+
consent: string;
|
811
|
+
};
|
812
|
+
type ConsentManagementProviderConfig = {
|
813
|
+
provider: ConsentManagementProvider;
|
814
|
+
consents: ConsentsConfig[];
|
815
|
+
resolutionStrategy: string | undefined;
|
816
|
+
};
|
817
|
+
type DestinationConfig = {
|
818
|
+
blacklistedEvents: DestinationEvent[];
|
819
|
+
whitelistedEvents: DestinationEvent[];
|
820
|
+
iubendaConsentPurposes?: IubendaConsentPurpose[];
|
821
|
+
oneTrustCookieCategories?: OneTrustCookieCategory[];
|
822
|
+
ketchConsentPurposes?: KetchConsentPurpose[];
|
823
|
+
consentManagement?: ConsentManagementProviderConfig[];
|
824
|
+
eventFilteringOption: EventFilteringOption;
|
825
|
+
clickEventConversions?: Conversion[];
|
826
|
+
pageLoadConversions?: Conversion[];
|
827
|
+
conversionID?: string;
|
828
|
+
conversionLinker?: boolean;
|
829
|
+
disableAdPersonalization?: boolean;
|
830
|
+
dynamicRemarketing?: boolean;
|
831
|
+
sendPageView?: boolean;
|
832
|
+
defaultPageConversion?: string;
|
833
|
+
enableConversionEventsFiltering?: boolean;
|
834
|
+
trackConversions?: boolean;
|
835
|
+
trackDynamicRemarketing?: boolean;
|
836
|
+
tagID?: string;
|
837
|
+
advertiserId?: string;
|
838
|
+
partnerId?: string;
|
839
|
+
measurementId?: string;
|
840
|
+
capturePageView?: string;
|
841
|
+
useNativeSDKToSend?: boolean;
|
842
|
+
connectionMode?: DestinationConnectionMode;
|
843
|
+
extendPageViewParams?: boolean;
|
844
|
+
eventMappingFromConfig?: EventMapping[];
|
845
|
+
appKey?: string;
|
846
|
+
dataCenter?: string;
|
847
|
+
enableBrazeLogging?: boolean;
|
848
|
+
enableNestedArrayOperations?: boolean;
|
849
|
+
enableSubscriptionGroupInGroupCall?: boolean;
|
850
|
+
supportDedup?: boolean;
|
851
|
+
trackAnonymousUser?: boolean;
|
852
|
+
serverUrl?: string;
|
853
|
+
containerID?: string;
|
854
|
+
fs_debug_mode?: boolean;
|
855
|
+
fs_org?: boolean;
|
856
|
+
siteID?: string;
|
857
|
+
[key: string]: any;
|
858
|
+
};
|
859
|
+
|
860
|
+
type StatsCollection = {
|
861
|
+
errors: {
|
862
|
+
enabled: boolean;
|
863
|
+
provider?: string;
|
864
|
+
};
|
865
|
+
metrics: {
|
866
|
+
enabled: boolean;
|
867
|
+
};
|
868
|
+
};
|
869
|
+
|
870
|
+
type DestinationDefinition = {
|
871
|
+
name: string;
|
872
|
+
displayName: string;
|
873
|
+
updatedAt: string;
|
874
|
+
};
|
875
|
+
type ConfigResponseDestinationItem = {
|
876
|
+
shouldApplyDeviceModeTransformation: boolean;
|
877
|
+
propagateEventsUntransformedOnError: boolean;
|
878
|
+
config: DestinationConfig;
|
879
|
+
updatedAt: string;
|
880
|
+
deleted: boolean;
|
881
|
+
destinationDefinition: DestinationDefinition;
|
882
|
+
enabled: boolean;
|
883
|
+
id: string;
|
884
|
+
name: string;
|
885
|
+
};
|
886
|
+
type Connection = {
|
887
|
+
createdAt: string;
|
888
|
+
deleted: boolean;
|
889
|
+
destinationId: string;
|
890
|
+
enabled: boolean;
|
891
|
+
id: string;
|
892
|
+
sourceId: string;
|
893
|
+
updatedAt: string;
|
894
|
+
};
|
895
|
+
type SourceDefinition = {
|
896
|
+
category: Nullable<any>;
|
897
|
+
config: Nullable<any>;
|
898
|
+
configSchema: Nullable<any>;
|
899
|
+
createdAt: string;
|
900
|
+
displayName: string;
|
901
|
+
id: string;
|
902
|
+
name: string;
|
903
|
+
options: Nullable<any>;
|
904
|
+
uiConfig: Nullable<any>;
|
905
|
+
updatedAt: string;
|
906
|
+
};
|
907
|
+
type SourceConfigResponse = {
|
908
|
+
consentManagementMetadata?: ConsentManagementMetadata;
|
909
|
+
source: {
|
910
|
+
destinations: ConfigResponseDestinationItem[];
|
911
|
+
sourceDefinitionId: string;
|
912
|
+
transient: boolean;
|
913
|
+
updatedAt: string;
|
914
|
+
workspaceId: string;
|
915
|
+
writeKey: string;
|
916
|
+
enabled: boolean;
|
917
|
+
id: string;
|
918
|
+
liveEventsConfig: {
|
919
|
+
eventUpload: boolean;
|
920
|
+
eventUploadTS: number;
|
921
|
+
};
|
922
|
+
name: string;
|
923
|
+
secretVersion: Nullable<string>;
|
924
|
+
sourceDefinition: SourceDefinition;
|
925
|
+
config: {
|
926
|
+
statsCollection: StatsCollection;
|
927
|
+
};
|
928
|
+
connections: Connection[];
|
929
|
+
createdAt: string;
|
930
|
+
createdBy: string;
|
931
|
+
deleted: boolean;
|
932
|
+
};
|
933
|
+
};
|
797
934
|
interface IConfigManager {
|
798
935
|
httpClient: IHttpClient;
|
799
|
-
errorHandler
|
800
|
-
logger
|
936
|
+
errorHandler: IErrorHandler;
|
937
|
+
logger: ILogger;
|
801
938
|
init: () => void;
|
802
939
|
getConfig: () => void;
|
803
|
-
processConfig: () => void;
|
940
|
+
processConfig: (response: SourceConfigResponse | string | undefined, details?: ResponseDetails) => void;
|
804
941
|
}
|
805
942
|
|
806
943
|
interface IEventManager {
|
@@ -810,8 +947,9 @@ interface IEventManager {
|
|
810
947
|
}
|
811
948
|
|
812
949
|
interface ICapabilitiesManager {
|
813
|
-
|
814
|
-
errorHandler
|
950
|
+
httpClient: IHttpClient;
|
951
|
+
errorHandler: IErrorHandler;
|
952
|
+
logger: ILogger;
|
815
953
|
externalSrcLoader: IExternalSrcLoader;
|
816
954
|
init(): void;
|
817
955
|
detectBrowserCapabilities(): void;
|