@rudderstack/analytics-js 3.21.0-beta.pr.2309.4f0ffa0 → 3.21.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.
@@ -14,7 +14,6 @@ interface ILogger {
14
14
  setMinLogLevel(logLevel: LogLevel): void;
15
15
  }
16
16
  type LogLevel = 'LOG' | 'INFO' | 'DEBUG' | 'WARN' | 'ERROR' | 'NONE';
17
- type RSALogger = Pick<ILogger, 'log' | 'info' | 'debug' | 'warn' | 'error' | 'setMinLogLevel'>;
18
17
 
19
18
  type LoggerProvider = Record<Exclude<Lowercase<LogLevel>, Lowercase<'NONE'>>, (...data: any[]) => void>;
20
19
 
@@ -63,7 +62,6 @@ type IntegrationOpts = {
63
62
  [index: string]: DestinationIntgConfig;
64
63
  };
65
64
 
66
- type Traits = Nullable<ApiObject>;
67
65
  type ApiCallback = (data?: any) => void;
68
66
  /**
69
67
  * Represents the options parameter in the APIs
@@ -163,11 +161,6 @@ type CookieSameSite = 'Strict' | 'Lax' | 'None';
163
161
  type OneTrustCookieCategory = {
164
162
  oneTrustCookieCategory: string;
165
163
  };
166
- type ConsentManagement = {
167
- deniedConsentIds: Consents;
168
- allowedConsentIds: Consents;
169
- provider: ConsentManagementProvider;
170
- };
171
164
  type ConsentManagementMetadata = {
172
165
  providers: ConsentManagementProviderMetadata[];
173
166
  };
@@ -428,76 +421,6 @@ type IdentifyTraits = {
428
421
  [index: string]: string | number | boolean | ApiObject | null | Date | (string | number | boolean | null | Date | ApiObject)[] | undefined;
429
422
  };
430
423
 
431
- type AppInfo = {
432
- readonly name: string;
433
- readonly version: string;
434
- readonly namespace: string;
435
- readonly installType: string;
436
- };
437
- type LibraryInfo = {
438
- readonly name: string;
439
- readonly version: string;
440
- readonly snippetVersion?: string;
441
- };
442
- type OSInfo = {
443
- readonly name: string;
444
- readonly version: string;
445
- };
446
- type ScreenInfo = {
447
- readonly density: number;
448
- readonly width: number;
449
- readonly height: number;
450
- readonly innerWidth: number;
451
- readonly innerHeight: number;
452
- };
453
- type UTMParameters = Record<string, string>;
454
-
455
- type PageLifecycle = {
456
- pageViewId: string;
457
- };
458
- type AutoTrack = {
459
- page: PageLifecycle;
460
- };
461
- type RudderContext = {
462
- [index: string]: string | number | boolean | ApiObject | UADataValues | Nullable<string> | (string | number | boolean | ApiObject)[] | undefined;
463
- traits?: Nullable<ApiObject>;
464
- sessionId?: number;
465
- sessionStart?: boolean;
466
- consentManagement?: ConsentManagement;
467
- 'ua-ch'?: UADataValues;
468
- app: AppInfo;
469
- library: LibraryInfo;
470
- userAgent: Nullable<string>;
471
- os: OSInfo;
472
- locale: Nullable<string>;
473
- screen: ScreenInfo;
474
- campaign?: UTMParameters;
475
- trulyAnonymousTracking?: boolean;
476
- timezone: string;
477
- autoTrack?: AutoTrack;
478
- };
479
- type RudderEvent = {
480
- type: RudderEventType;
481
- channel: string;
482
- anonymousId: string;
483
- context: RudderContext;
484
- originalTimestamp: string;
485
- integrations: IntegrationOpts;
486
- messageId: string;
487
- event: Nullable<string>;
488
- previousId?: string;
489
- userId?: Nullable<string>;
490
- sentAt?: string;
491
- properties?: Nullable<ApiObject>;
492
- name?: Nullable<string>;
493
- category?: Nullable<string>;
494
- traits?: Traits;
495
- groupId?: Nullable<string>;
496
- };
497
- type RSAEvent = {
498
- message: RudderEvent;
499
- };
500
-
501
424
  type AnalyticsIdentifyMethod = {
502
425
  (userId: string, traits?: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
503
426
  (userId: string, traits?: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
@@ -635,75 +558,7 @@ interface IRudderAnalytics<T = any> {
635
558
  * @param options Consent API options
636
559
  */
637
560
  consent(options?: ConsentOptions): void;
638
- /**
639
- * To add a custom integration
640
- * @param name The name of the custom integration
641
- * @param integration The custom integration object
642
- */
643
- addCustomIntegration(name: string, integration: RSACustomIntegration): void;
644
561
  }
645
- type RSAnalytics = Pick<IRudderAnalytics, 'track' | 'page' | 'identify' | 'group' | 'alias' | 'getAnonymousId' | 'getUserId' | 'getUserTraits' | 'getGroupId' | 'getGroupTraits' | 'getSessionId'>;
646
- /**
647
- * Type for the custom integration to be used in addCustomIntegration API
648
- * Defines the contract that all custom integrations must implement
649
- */
650
- type RSACustomIntegration = {
651
- /**
652
- * Initialize the integration
653
- * @param analytics - The RudderStack analytics instance
654
- * @param logger - The logger instance for this integration
655
- * @optional
656
- */
657
- init?: (analytics: RSAnalytics, logger: RSALogger) => void;
658
- /**
659
- * Check if the integration is ready to process events
660
- * @param analytics - The RudderStack analytics instance
661
- * @param logger - The logger instance for this integration
662
- * @returns boolean indicating whether the integration is ready
663
- * @required
664
- */
665
- isReady: (analytics: RSAnalytics, logger: RSALogger) => boolean;
666
- /**
667
- * Process track events
668
- * @param analytics - The RudderStack analytics instance
669
- * @param logger - The logger instance for this integration
670
- * @param event - The track event payload to process
671
- * @optional
672
- */
673
- track?: (analytics: RSAnalytics, logger: RSALogger, event: RSAEvent) => void;
674
- /**
675
- * Process page events
676
- * @param analytics - The RudderStack analytics instance
677
- * @param logger - The logger instance for this integration
678
- * @param event - The page event payload to process
679
- * @optional
680
- */
681
- page?: (analytics: RSAnalytics, logger: RSALogger, event: RSAEvent) => void;
682
- /**
683
- * Process identify events
684
- * @param analytics - The RudderStack analytics instance
685
- * @param logger - The logger instance for this integration
686
- * @param event - The identify event payload to process
687
- * @optional
688
- */
689
- identify?: (analytics: RSAnalytics, logger: RSALogger, event: RSAEvent) => void;
690
- /**
691
- * Process group events
692
- * @param analytics - The RudderStack analytics instance
693
- * @param logger - The logger instance for this integration
694
- * @param event - The group event payload to process
695
- * @optional
696
- */
697
- group?: (analytics: RSAnalytics, logger: RSALogger, event: RSAEvent) => void;
698
- /**
699
- * Process alias events
700
- * @param analytics - The RudderStack analytics instance
701
- * @param logger - The logger instance for this integration
702
- * @param event - The alias event payload to process
703
- * @optional
704
- */
705
- alias?: (analytics: RSAnalytics, logger: RSALogger, event: RSAEvent) => void;
706
- };
707
562
 
708
563
  type SDKError = unknown | Error | ErrorEvent | Event | PromiseRejectionEvent;
709
564
  type ErrorInfo = {
@@ -1278,13 +1133,6 @@ interface IAnalytics {
1278
1133
  * To set auth token
1279
1134
  */
1280
1135
  setAuthToken(token: string): void;
1281
- /**
1282
- * Add a custom integration to the SDK
1283
- * @param name - Unique name for the custom integration
1284
- * @param integration - The custom integration instance implementing RSACustomIntegration
1285
- * @param isBufferedInvocation - Internal flag to indicate if this is a buffered call
1286
- */
1287
- addCustomIntegration(name: string, integration: RSACustomIntegration, isBufferedInvocation?: boolean): void;
1288
1136
  }
1289
1137
 
1290
1138
  declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
@@ -1293,12 +1141,6 @@ declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
1293
1141
  defaultAnalyticsKey: string;
1294
1142
  logger: Logger;
1295
1143
  constructor();
1296
- /**
1297
- * Create an instance of the current instance that can be used
1298
- * to call a subset of methods of the current instance.
1299
- * It is typically used to expose the analytics instance to the integrations (standard and custom)
1300
- */
1301
- createSafeAnalyticsInstance(): void;
1302
1144
  static initializeGlobalResources(): void;
1303
1145
  /**
1304
1146
  * Set instance to use if no specific writeKey is provided in methods
@@ -1393,7 +1235,6 @@ declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
1393
1235
  getSessionId(): Nullable<number> | undefined;
1394
1236
  setAuthToken(token: string): void;
1395
1237
  consent(options?: ConsentOptions): void;
1396
- addCustomIntegration(name: string, integration: RSACustomIntegration): void;
1397
1238
  }
1398
1239
  //# sourceMappingURL=RudderAnalytics.d.ts.map
1399
1240
 
@@ -1405,4 +1246,4 @@ declare global {
1405
1246
  //# sourceMappingURL=index.d.ts.map
1406
1247
 
1407
1248
  export { RudderAnalytics };
1408
- export type { AnonymousIdOptions, ApiCallback, ApiObject, ApiOptions, BeaconQueueOpts, ConsentOptions, CookieSameSite, DestinationsQueueOpts, IdentifyTraits, IntegrationOpts, LoadOptions, LogLevel, PluginName, PreloadedEventCall, QueueOpts, RSACustomIntegration, RSAEvent, RSALogger, RSAnalytics, RudderAnalyticsPreloader, SessionOpts, UaChTrackLevel };
1249
+ export type { AnonymousIdOptions, ApiCallback, ApiObject, ApiOptions, BeaconQueueOpts, ConsentOptions, CookieSameSite, DestinationsQueueOpts, IdentifyTraits, IntegrationOpts, LoadOptions, LogLevel, PluginName, PreloadedEventCall, QueueOpts, RudderAnalyticsPreloader, SessionOpts, UaChTrackLevel };
@@ -14,7 +14,6 @@ interface ILogger {
14
14
  setMinLogLevel(logLevel: LogLevel): void;
15
15
  }
16
16
  type LogLevel = 'LOG' | 'INFO' | 'DEBUG' | 'WARN' | 'ERROR' | 'NONE';
17
- type RSALogger = Pick<ILogger, 'log' | 'info' | 'debug' | 'warn' | 'error' | 'setMinLogLevel'>;
18
17
 
19
18
  type LoggerProvider = Record<Exclude<Lowercase<LogLevel>, Lowercase<'NONE'>>, (...data: any[]) => void>;
20
19
 
@@ -63,7 +62,6 @@ type IntegrationOpts = {
63
62
  [index: string]: DestinationIntgConfig;
64
63
  };
65
64
 
66
- type Traits = Nullable<ApiObject>;
67
65
  type ApiCallback = (data?: any) => void;
68
66
  /**
69
67
  * Represents the options parameter in the APIs
@@ -163,11 +161,6 @@ type CookieSameSite = 'Strict' | 'Lax' | 'None';
163
161
  type OneTrustCookieCategory = {
164
162
  oneTrustCookieCategory: string;
165
163
  };
166
- type ConsentManagement = {
167
- deniedConsentIds: Consents;
168
- allowedConsentIds: Consents;
169
- provider: ConsentManagementProvider;
170
- };
171
164
  type ConsentManagementMetadata = {
172
165
  providers: ConsentManagementProviderMetadata[];
173
166
  };
@@ -428,76 +421,6 @@ type IdentifyTraits = {
428
421
  [index: string]: string | number | boolean | ApiObject | null | Date | (string | number | boolean | null | Date | ApiObject)[] | undefined;
429
422
  };
430
423
 
431
- type AppInfo = {
432
- readonly name: string;
433
- readonly version: string;
434
- readonly namespace: string;
435
- readonly installType: string;
436
- };
437
- type LibraryInfo = {
438
- readonly name: string;
439
- readonly version: string;
440
- readonly snippetVersion?: string;
441
- };
442
- type OSInfo = {
443
- readonly name: string;
444
- readonly version: string;
445
- };
446
- type ScreenInfo = {
447
- readonly density: number;
448
- readonly width: number;
449
- readonly height: number;
450
- readonly innerWidth: number;
451
- readonly innerHeight: number;
452
- };
453
- type UTMParameters = Record<string, string>;
454
-
455
- type PageLifecycle = {
456
- pageViewId: string;
457
- };
458
- type AutoTrack = {
459
- page: PageLifecycle;
460
- };
461
- type RudderContext = {
462
- [index: string]: string | number | boolean | ApiObject | UADataValues | Nullable<string> | (string | number | boolean | ApiObject)[] | undefined;
463
- traits?: Nullable<ApiObject>;
464
- sessionId?: number;
465
- sessionStart?: boolean;
466
- consentManagement?: ConsentManagement;
467
- 'ua-ch'?: UADataValues;
468
- app: AppInfo;
469
- library: LibraryInfo;
470
- userAgent: Nullable<string>;
471
- os: OSInfo;
472
- locale: Nullable<string>;
473
- screen: ScreenInfo;
474
- campaign?: UTMParameters;
475
- trulyAnonymousTracking?: boolean;
476
- timezone: string;
477
- autoTrack?: AutoTrack;
478
- };
479
- type RudderEvent = {
480
- type: RudderEventType;
481
- channel: string;
482
- anonymousId: string;
483
- context: RudderContext;
484
- originalTimestamp: string;
485
- integrations: IntegrationOpts;
486
- messageId: string;
487
- event: Nullable<string>;
488
- previousId?: string;
489
- userId?: Nullable<string>;
490
- sentAt?: string;
491
- properties?: Nullable<ApiObject>;
492
- name?: Nullable<string>;
493
- category?: Nullable<string>;
494
- traits?: Traits;
495
- groupId?: Nullable<string>;
496
- };
497
- type RSAEvent = {
498
- message: RudderEvent;
499
- };
500
-
501
424
  type AnalyticsIdentifyMethod = {
502
425
  (userId: string, traits?: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
503
426
  (userId: string, traits?: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
@@ -635,75 +558,7 @@ interface IRudderAnalytics<T = any> {
635
558
  * @param options Consent API options
636
559
  */
637
560
  consent(options?: ConsentOptions): void;
638
- /**
639
- * To add a custom integration
640
- * @param name The name of the custom integration
641
- * @param integration The custom integration object
642
- */
643
- addCustomIntegration(name: string, integration: RSACustomIntegration): void;
644
561
  }
645
- type RSAnalytics = Pick<IRudderAnalytics, 'track' | 'page' | 'identify' | 'group' | 'alias' | 'getAnonymousId' | 'getUserId' | 'getUserTraits' | 'getGroupId' | 'getGroupTraits' | 'getSessionId'>;
646
- /**
647
- * Type for the custom integration to be used in addCustomIntegration API
648
- * Defines the contract that all custom integrations must implement
649
- */
650
- type RSACustomIntegration = {
651
- /**
652
- * Initialize the integration
653
- * @param analytics - The RudderStack analytics instance
654
- * @param logger - The logger instance for this integration
655
- * @optional
656
- */
657
- init?: (analytics: RSAnalytics, logger: RSALogger) => void;
658
- /**
659
- * Check if the integration is ready to process events
660
- * @param analytics - The RudderStack analytics instance
661
- * @param logger - The logger instance for this integration
662
- * @returns boolean indicating whether the integration is ready
663
- * @required
664
- */
665
- isReady: (analytics: RSAnalytics, logger: RSALogger) => boolean;
666
- /**
667
- * Process track events
668
- * @param analytics - The RudderStack analytics instance
669
- * @param logger - The logger instance for this integration
670
- * @param event - The track event payload to process
671
- * @optional
672
- */
673
- track?: (analytics: RSAnalytics, logger: RSALogger, event: RSAEvent) => void;
674
- /**
675
- * Process page events
676
- * @param analytics - The RudderStack analytics instance
677
- * @param logger - The logger instance for this integration
678
- * @param event - The page event payload to process
679
- * @optional
680
- */
681
- page?: (analytics: RSAnalytics, logger: RSALogger, event: RSAEvent) => void;
682
- /**
683
- * Process identify events
684
- * @param analytics - The RudderStack analytics instance
685
- * @param logger - The logger instance for this integration
686
- * @param event - The identify event payload to process
687
- * @optional
688
- */
689
- identify?: (analytics: RSAnalytics, logger: RSALogger, event: RSAEvent) => void;
690
- /**
691
- * Process group events
692
- * @param analytics - The RudderStack analytics instance
693
- * @param logger - The logger instance for this integration
694
- * @param event - The group event payload to process
695
- * @optional
696
- */
697
- group?: (analytics: RSAnalytics, logger: RSALogger, event: RSAEvent) => void;
698
- /**
699
- * Process alias events
700
- * @param analytics - The RudderStack analytics instance
701
- * @param logger - The logger instance for this integration
702
- * @param event - The alias event payload to process
703
- * @optional
704
- */
705
- alias?: (analytics: RSAnalytics, logger: RSALogger, event: RSAEvent) => void;
706
- };
707
562
 
708
563
  type SDKError = unknown | Error | ErrorEvent | Event | PromiseRejectionEvent;
709
564
  type ErrorInfo = {
@@ -1278,13 +1133,6 @@ interface IAnalytics {
1278
1133
  * To set auth token
1279
1134
  */
1280
1135
  setAuthToken(token: string): void;
1281
- /**
1282
- * Add a custom integration to the SDK
1283
- * @param name - Unique name for the custom integration
1284
- * @param integration - The custom integration instance implementing RSACustomIntegration
1285
- * @param isBufferedInvocation - Internal flag to indicate if this is a buffered call
1286
- */
1287
- addCustomIntegration(name: string, integration: RSACustomIntegration, isBufferedInvocation?: boolean): void;
1288
1136
  }
1289
1137
 
1290
1138
  declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
@@ -1293,12 +1141,6 @@ declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
1293
1141
  defaultAnalyticsKey: string;
1294
1142
  logger: Logger;
1295
1143
  constructor();
1296
- /**
1297
- * Create an instance of the current instance that can be used
1298
- * to call a subset of methods of the current instance.
1299
- * It is typically used to expose the analytics instance to the integrations (standard and custom)
1300
- */
1301
- createSafeAnalyticsInstance(): void;
1302
1144
  static initializeGlobalResources(): void;
1303
1145
  /**
1304
1146
  * Set instance to use if no specific writeKey is provided in methods
@@ -1393,7 +1235,6 @@ declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
1393
1235
  getSessionId(): Nullable<number> | undefined;
1394
1236
  setAuthToken(token: string): void;
1395
1237
  consent(options?: ConsentOptions): void;
1396
- addCustomIntegration(name: string, integration: RSACustomIntegration): void;
1397
1238
  }
1398
1239
  //# sourceMappingURL=RudderAnalytics.d.ts.map
1399
1240
 
@@ -1405,4 +1246,4 @@ declare global {
1405
1246
  //# sourceMappingURL=index.d.ts.map
1406
1247
 
1407
1248
  export { RudderAnalytics };
1408
- export type { AnonymousIdOptions, ApiCallback, ApiObject, ApiOptions, BeaconQueueOpts, ConsentOptions, CookieSameSite, DestinationsQueueOpts, IdentifyTraits, IntegrationOpts, LoadOptions, LogLevel, PluginName, PreloadedEventCall, QueueOpts, RSACustomIntegration, RSAEvent, RSALogger, RSAnalytics, RudderAnalyticsPreloader, SessionOpts, UaChTrackLevel };
1249
+ export type { AnonymousIdOptions, ApiCallback, ApiObject, ApiOptions, BeaconQueueOpts, ConsentOptions, CookieSameSite, DestinationsQueueOpts, IdentifyTraits, IntegrationOpts, LoadOptions, LogLevel, PluginName, PreloadedEventCall, QueueOpts, RudderAnalyticsPreloader, SessionOpts, UaChTrackLevel };