@journium/js 1.0.0 → 1.0.2

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/dist/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
3
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Journium = {}));
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.JourniumAnalytics = {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
7
  /**
@@ -431,9 +431,9 @@
431
431
  var _a;
432
432
  return typeof process !== 'undefined' && !!((_a = process.versions) === null || _a === void 0 ? void 0 : _a.node);
433
433
  };
434
- const fetchRemoteConfig = async (apiHost, token, fetchFn) => {
434
+ const fetchRemoteOptions = async (apiHost, publishableKey, fetchFn) => {
435
435
  const endpoint = '/v1/configs';
436
- const url = `${apiHost}${endpoint}?ingestion_key=${encodeURIComponent(token)}`;
436
+ const url = `${apiHost}${endpoint}?ingestion_key=${encodeURIComponent(publishableKey)}`;
437
437
  try {
438
438
  let fetch = fetchFn;
439
439
  if (!fetch) {
@@ -453,36 +453,43 @@
453
453
  },
454
454
  });
455
455
  if (!response.ok) {
456
- throw new Error(`Config fetch failed: ${response.status} ${response.statusText}`);
456
+ throw new Error(`Options fetch failed: ${response.status} ${response.statusText}`);
457
457
  }
458
458
  const data = await response.json();
459
459
  return data;
460
460
  }
461
461
  catch (error) {
462
- console.warn('Failed to fetch remote config:', error);
462
+ console.warn('Failed to fetch remote options:', error);
463
463
  return null;
464
464
  }
465
465
  };
466
- const mergeConfigs = (localConfig, remoteConfig) => {
467
- if (!remoteConfig) {
468
- return localConfig;
466
+ const mergeOptions = (localOptions, remoteOptions) => {
467
+ if (!remoteOptions && !localOptions) {
468
+ return {};
469
469
  }
470
- // Deep merge remote config into local config
471
- // Remote config takes precedence over local config
472
- const merged = { ...localConfig };
470
+ if (!remoteOptions) {
471
+ return localOptions;
472
+ }
473
+ if (!localOptions) {
474
+ return remoteOptions;
475
+ }
476
+ // Deep merge local options into remote options
477
+ // Local options takes precedence over remote options
478
+ const merged = { ...remoteOptions };
473
479
  // Handle primitive values
474
- Object.keys(remoteConfig).forEach(key => {
475
- if (remoteConfig[key] !== undefined && remoteConfig[key] !== null) {
476
- if (typeof remoteConfig[key] === 'object' && !Array.isArray(remoteConfig[key])) {
477
- // Deep merge objects
480
+ Object.keys(localOptions).forEach(key => {
481
+ const localValue = localOptions[key];
482
+ if (localValue !== undefined && localValue !== null) {
483
+ if (typeof localValue === 'object' && !Array.isArray(localValue)) {
484
+ // Deep merge objects - local options overrides remote
478
485
  merged[key] = {
479
486
  ...(merged[key] || {}),
480
- ...remoteConfig[key]
487
+ ...localValue
481
488
  };
482
489
  }
483
490
  else {
484
- // Override primitive values and arrays
485
- merged[key] = remoteConfig[key];
491
+ // Override primitive values and arrays with local options
492
+ merged[key] = localValue;
486
493
  }
487
494
  }
488
495
  });
@@ -491,14 +498,14 @@
491
498
 
492
499
  const DEFAULT_SESSION_TIMEOUT = 30 * 60 * 1000; // 30 minutes in ms
493
500
  class BrowserIdentityManager {
494
- constructor(sessionTimeout, token) {
501
+ constructor(sessionTimeout, publishableKey) {
495
502
  this.identity = null;
496
503
  this.sessionTimeout = DEFAULT_SESSION_TIMEOUT;
497
504
  if (sessionTimeout) {
498
505
  this.sessionTimeout = sessionTimeout;
499
506
  }
500
- // Generate storage key with token pattern: jrnm_<token>_journium
501
- this.storageKey = token ? `jrnm_${token}_journium` : '__journium_identity';
507
+ // Generate storage key with publishableKey pattern: jrnm_<publishableKey>_journium
508
+ this.storageKey = publishableKey ? `jrnm_${publishableKey}_journium` : '__journium_identity';
502
509
  this.loadOrCreateIdentity();
503
510
  }
504
511
  loadOrCreateIdentity() {
@@ -670,132 +677,122 @@
670
677
  this.flushTimer = null;
671
678
  this.initialized = false;
672
679
  // Validate required configuration
673
- if (!config.token) {
674
- console.error('Journium: token is required but not provided. SDK will not function.');
680
+ if (!config.publishableKey) {
681
+ console.error('Journium: publishableKey is required but not provided. SDK will not function.');
675
682
  return;
676
683
  }
677
- if (!config.apiHost) {
678
- console.error('Journium: apiHost is required but not provided. SDK will not function.');
679
- return;
684
+ // Set default apiHost if not provided
685
+ this.config = {
686
+ ...config,
687
+ apiHost: config.apiHost || 'https://events.journium.app'
688
+ };
689
+ // Generate storage key for options caching
690
+ this.optionsStorageKey = `jrnm_${config.publishableKey}_options`;
691
+ // Generate default values
692
+ const defaultOptions = {
693
+ debug: false,
694
+ flushAt: 20,
695
+ flushInterval: 10000,
696
+ sessionTimeout: 30 * 60 * 1000, // 30 minutes
697
+ };
698
+ // Initialize effective options with local options taking precedence over defaults
699
+ this.effectiveOptions = { ...defaultOptions };
700
+ if (this.config.options) {
701
+ this.effectiveOptions = mergeOptions(defaultOptions, this.config.options);
680
702
  }
681
- this.config = config;
682
- // Generate storage key for config caching
683
- this.configStorageKey = `jrnm_${config.token}_config`;
684
703
  // Initialize identity manager
685
- this.identityManager = new BrowserIdentityManager(this.config.sessionTimeout, this.config.token);
704
+ this.identityManager = new BrowserIdentityManager(this.effectiveOptions.sessionTimeout, this.config.publishableKey);
686
705
  // Initialize synchronously with cached config, fetch fresh config in background
687
706
  this.initializeSync();
688
- this.fetchRemoteConfigAsync();
707
+ this.fetchRemoteOptionsAsync();
689
708
  }
690
- loadCachedConfig() {
709
+ loadCachedOptions() {
710
+ var _a;
691
711
  if (typeof window === 'undefined' || !window.localStorage) {
692
712
  return null;
693
713
  }
694
714
  try {
695
- const cached = window.localStorage.getItem(this.configStorageKey);
715
+ const cached = window.localStorage.getItem(this.optionsStorageKey);
696
716
  return cached ? JSON.parse(cached) : null;
697
717
  }
698
718
  catch (error) {
699
- if (this.config.debug) {
719
+ if ((_a = this.effectiveOptions) === null || _a === void 0 ? void 0 : _a.debug) {
700
720
  console.warn('Journium: Failed to load cached config:', error);
701
721
  }
702
722
  return null;
703
723
  }
704
724
  }
705
- saveCachedConfig(config) {
725
+ saveCachedOptions(options) {
726
+ var _a;
706
727
  if (typeof window === 'undefined' || !window.localStorage) {
707
728
  return;
708
729
  }
709
730
  try {
710
- window.localStorage.setItem(this.configStorageKey, JSON.stringify(config));
731
+ window.localStorage.setItem(this.optionsStorageKey, JSON.stringify(options));
711
732
  }
712
733
  catch (error) {
713
- if (this.config.debug) {
734
+ if ((_a = this.effectiveOptions) === null || _a === void 0 ? void 0 : _a.debug) {
714
735
  console.warn('Journium: Failed to save config to cache:', error);
715
736
  }
716
737
  }
717
738
  }
718
739
  initializeSync() {
719
- var _a, _b, _c;
720
- // Step 1: Load cached config from localStorage (synchronous)
721
- const cachedConfig = this.loadCachedConfig();
722
- // Step 2: Apply cached config immediately, or use defaults
723
- const localOnlyConfig = {
724
- apiHost: this.config.apiHost,
725
- token: this.config.token,
726
- };
727
- if (cachedConfig) {
728
- // Use cached remote config
729
- this.config = {
730
- ...localOnlyConfig,
731
- ...cachedConfig,
732
- };
733
- if (this.config.debug) {
734
- console.log('Journium: Using cached configuration:', cachedConfig);
740
+ // Step 1: Load cached remote options from localStorage (synchronous)
741
+ const cachedRemoteOptions = this.loadCachedOptions();
742
+ // Step 2: If no local options provided, use cached remote options
743
+ if (!this.config.options && cachedRemoteOptions) {
744
+ this.effectiveOptions = cachedRemoteOptions;
745
+ if (this.effectiveOptions.debug) {
746
+ console.log('Journium: Using cached remote options:', cachedRemoteOptions);
735
747
  }
736
748
  }
737
- else {
738
- // Use defaults for first-time initialization
739
- this.config = {
740
- ...this.config,
741
- debug: (_a = this.config.debug) !== null && _a !== void 0 ? _a : false,
742
- flushAt: (_b = this.config.flushAt) !== null && _b !== void 0 ? _b : 20,
743
- flushInterval: (_c = this.config.flushInterval) !== null && _c !== void 0 ? _c : 10000,
744
- };
745
- if (this.config.debug) {
746
- console.log('Journium: No cached config found, using defaults');
747
- }
748
- }
749
- // Update session timeout from config
750
- if (this.config.sessionTimeout) {
751
- this.identityManager.updateSessionTimeout(this.config.sessionTimeout);
752
- }
753
749
  // Step 3: Mark as initialized immediately - no need to wait for remote fetch
754
750
  this.initialized = true;
755
751
  // Step 4: Start flush timer immediately
756
- if (this.config.flushInterval && this.config.flushInterval > 0) {
752
+ if (this.effectiveOptions.flushInterval && this.effectiveOptions.flushInterval > 0) {
757
753
  this.startFlushTimer();
758
754
  }
759
- if (this.config.debug) {
760
- console.log('Journium: Client initialized and ready to track events');
755
+ if (this.effectiveOptions.debug) {
756
+ console.log('Journium: Client initialized with effective options:', this.effectiveOptions);
761
757
  }
762
758
  }
763
- async fetchRemoteConfigAsync() {
759
+ async fetchRemoteOptionsAsync() {
764
760
  // Fetch fresh config in background
765
- if (this.config.token) {
766
- await this.fetchAndCacheRemoteConfig();
761
+ if (this.config.publishableKey) {
762
+ await this.fetchAndCacheRemoteOptions();
767
763
  }
768
764
  }
769
- async fetchAndCacheRemoteConfig() {
765
+ async fetchAndCacheRemoteOptions() {
770
766
  try {
771
- if (this.config.debug) {
767
+ if (this.effectiveOptions.debug) {
772
768
  console.log('Journium: Fetching remote configuration in background...');
773
769
  }
774
- const remoteConfigResponse = await fetchRemoteConfig(this.config.apiHost, this.config.token);
775
- if (remoteConfigResponse && remoteConfigResponse.success) {
776
- // Save to cache for next session
777
- this.saveCachedConfig(remoteConfigResponse.config);
778
- // Apply fresh config to current session
779
- const localOnlyConfig = {
780
- apiHost: this.config.apiHost,
781
- token: this.config.token,
782
- };
783
- this.config = {
784
- ...localOnlyConfig,
785
- ...remoteConfigResponse.config,
786
- };
787
- // Update session timeout if provided in fresh config
788
- if (remoteConfigResponse.config.sessionTimeout) {
789
- this.identityManager.updateSessionTimeout(remoteConfigResponse.config.sessionTimeout);
770
+ const remoteOptionsResponse = await fetchRemoteOptions(this.config.apiHost, this.config.publishableKey);
771
+ if (remoteOptionsResponse && remoteOptionsResponse.success) {
772
+ // Save remote config to cache for next session
773
+ this.saveCachedOptions(remoteOptionsResponse.config);
774
+ // Update effective options: local options (if provided) overrides fresh remote options
775
+ if (!this.config.options) {
776
+ // No local options provided, use fresh remote options
777
+ this.effectiveOptions = remoteOptionsResponse.config;
778
+ }
779
+ else {
780
+ // Local options provided, merge it over fresh remote options
781
+ this.effectiveOptions = mergeOptions(remoteOptionsResponse.config, this.config.options);
790
782
  }
791
- if (this.config.debug) {
792
- console.log('Journium: Background remote configuration applied:', remoteConfigResponse.config);
783
+ // Update session timeout if provided in fresh effective options
784
+ if (this.effectiveOptions.sessionTimeout) {
785
+ this.identityManager.updateSessionTimeout(this.effectiveOptions.sessionTimeout);
786
+ }
787
+ if (this.effectiveOptions.debug) {
788
+ console.log('Journium: Background remote options applied:', remoteOptionsResponse.config);
789
+ console.log('Journium: New effective options:', this.effectiveOptions);
793
790
  }
794
791
  }
795
792
  }
796
793
  catch (error) {
797
- if (this.config.debug) {
798
- console.warn('Journium: Background remote config fetch failed:', error);
794
+ if (this.effectiveOptions.debug) {
795
+ console.warn('Journium: Background remote options fetch failed:', error);
799
796
  }
800
797
  }
801
798
  }
@@ -806,7 +803,7 @@
806
803
  // Use universal setInterval (works in both browser and Node.js)
807
804
  this.flushTimer = setInterval(() => {
808
805
  this.flush();
809
- }, this.config.flushInterval);
806
+ }, this.effectiveOptions.flushInterval);
810
807
  }
811
808
  async sendEvents(events) {
812
809
  if (!events.length)
@@ -816,7 +813,7 @@
816
813
  method: 'POST',
817
814
  headers: {
818
815
  'Content-Type': 'application/json',
819
- 'Authorization': `Bearer ${this.config.token}`,
816
+ 'Authorization': `Bearer ${this.config.publishableKey}`,
820
817
  },
821
818
  body: JSON.stringify({
822
819
  events,
@@ -825,12 +822,12 @@
825
822
  if (!response.ok) {
826
823
  throw new Error(`HTTP ${response.status}: ${response.statusText}`);
827
824
  }
828
- if (this.config.debug) {
825
+ if (this.effectiveOptions.debug) {
829
826
  console.log('Journium: Successfully sent events', events);
830
827
  }
831
828
  }
832
829
  catch (error) {
833
- if (this.config.debug) {
830
+ if (this.effectiveOptions.debug) {
834
831
  console.error('Journium: Failed to send events', error);
835
832
  }
836
833
  throw error;
@@ -839,8 +836,8 @@
839
836
  identify(distinctId, attributes = {}) {
840
837
  var _a;
841
838
  // Don't identify if SDK is not properly configured
842
- if (!this.config || !this.config.token || !this.config.apiHost || !this.initialized) {
843
- if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.debug) {
839
+ if (!this.config || !this.config.publishableKey || !this.initialized) {
840
+ if ((_a = this.effectiveOptions) === null || _a === void 0 ? void 0 : _a.debug) {
844
841
  console.warn('Journium: identify() call rejected - SDK not ready');
845
842
  }
846
843
  return;
@@ -853,30 +850,30 @@
853
850
  $anon_distinct_id: previousDistinctId,
854
851
  };
855
852
  this.track('$identify', identifyProperties);
856
- if (this.config.debug) {
853
+ if (this.effectiveOptions.debug) {
857
854
  console.log('Journium: User identified', { distinctId, attributes, previousDistinctId });
858
855
  }
859
856
  }
860
857
  reset() {
861
858
  var _a;
862
859
  // Don't reset if SDK is not properly configured
863
- if (!this.config || !this.config.token || !this.config.apiHost || !this.initialized) {
864
- if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.debug) {
860
+ if (!this.config || !this.config.publishableKey || !this.initialized) {
861
+ if ((_a = this.effectiveOptions) === null || _a === void 0 ? void 0 : _a.debug) {
865
862
  console.warn('Journium: reset() call rejected - SDK not ready');
866
863
  }
867
864
  return;
868
865
  }
869
866
  // Reset identity in identity manager
870
867
  this.identityManager.reset();
871
- if (this.config.debug) {
868
+ if (this.effectiveOptions.debug) {
872
869
  console.log('Journium: User identity reset');
873
870
  }
874
871
  }
875
872
  track(event, properties = {}) {
876
873
  var _a;
877
874
  // Don't track if SDK is not properly configured
878
- if (!this.config || !this.config.token || !this.config.apiHost || !this.initialized) {
879
- if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.debug) {
875
+ if (!this.config || !this.config.publishableKey || !this.initialized) {
876
+ if ((_a = this.effectiveOptions) === null || _a === void 0 ? void 0 : _a.debug) {
880
877
  console.warn('Journium: track() call rejected - SDK not ready');
881
878
  }
882
879
  return;
@@ -898,22 +895,22 @@
898
895
  };
899
896
  const journiumEvent = {
900
897
  uuid: generateUuidv7(),
901
- ingestion_key: this.config.token,
898
+ ingestion_key: this.config.publishableKey,
902
899
  client_timestamp: getCurrentTimestamp(),
903
900
  event,
904
901
  properties: eventProperties,
905
902
  };
906
903
  this.queue.push(journiumEvent);
907
- if (this.config.debug) {
904
+ if (this.effectiveOptions.debug) {
908
905
  console.log('Journium: Event tracked', journiumEvent);
909
906
  }
910
- if (this.queue.length >= this.config.flushAt) {
907
+ if (this.queue.length >= this.effectiveOptions.flushAt) {
911
908
  this.flush();
912
909
  }
913
910
  }
914
911
  async flush() {
915
912
  // Don't flush if SDK is not properly configured
916
- if (!this.config || !this.config.token || !this.config.apiHost) {
913
+ if (!this.config || !this.config.publishableKey) {
917
914
  return;
918
915
  }
919
916
  if (this.queue.length === 0)
@@ -935,6 +932,9 @@
935
932
  }
936
933
  this.flush();
937
934
  }
935
+ getEffectiveOptions() {
936
+ return this.effectiveOptions;
937
+ }
938
938
  }
939
939
 
940
940
  class PageviewTracker {
@@ -960,7 +960,7 @@
960
960
  this.client.track('$pageview', properties);
961
961
  this.lastUrl = currentUrl;
962
962
  }
963
- startAutoCapture() {
963
+ startAutocapture() {
964
964
  this.capturePageview();
965
965
  if (typeof window !== 'undefined') {
966
966
  // Store original methods for cleanup
@@ -980,7 +980,7 @@
980
980
  window.addEventListener('popstate', this.popStateHandler);
981
981
  }
982
982
  }
983
- stopAutoCapture() {
983
+ stopAutocapture() {
984
984
  if (typeof window !== 'undefined') {
985
985
  // Restore original methods
986
986
  if (this.originalPushState) {
@@ -1000,11 +1000,11 @@
1000
1000
  }
1001
1001
 
1002
1002
  class AutocaptureTracker {
1003
- constructor(client, config = {}) {
1003
+ constructor(client, options = {}) {
1004
1004
  this.listeners = new Map();
1005
1005
  this.isActive = false;
1006
1006
  this.client = client;
1007
- this.config = {
1007
+ this.options = {
1008
1008
  captureClicks: true,
1009
1009
  captureFormSubmits: true,
1010
1010
  captureFormChanges: true,
@@ -1012,7 +1012,7 @@
1012
1012
  ignoreClasses: ['journium-ignore'],
1013
1013
  ignoreElements: ['script', 'style', 'noscript'],
1014
1014
  captureContentText: true,
1015
- ...config,
1015
+ ...options,
1016
1016
  };
1017
1017
  }
1018
1018
  start() {
@@ -1020,16 +1020,16 @@
1020
1020
  return;
1021
1021
  }
1022
1022
  this.isActive = true;
1023
- if (this.config.captureClicks) {
1023
+ if (this.options.captureClicks) {
1024
1024
  this.addClickListener();
1025
1025
  }
1026
- if (this.config.captureFormSubmits) {
1026
+ if (this.options.captureFormSubmits) {
1027
1027
  this.addFormSubmitListener();
1028
1028
  }
1029
- if (this.config.captureFormChanges) {
1029
+ if (this.options.captureFormChanges) {
1030
1030
  this.addFormChangeListener();
1031
1031
  }
1032
- if (this.config.captureTextSelection) {
1032
+ if (this.options.captureTextSelection) {
1033
1033
  this.addTextSelectionListener();
1034
1034
  }
1035
1035
  }
@@ -1113,17 +1113,17 @@
1113
1113
  return true;
1114
1114
  }
1115
1115
  // Check if element should be ignored by tag name
1116
- if ((_a = this.config.ignoreElements) === null || _a === void 0 ? void 0 : _a.includes(element.tagName.toLowerCase())) {
1116
+ if ((_a = this.options.ignoreElements) === null || _a === void 0 ? void 0 : _a.includes(element.tagName.toLowerCase())) {
1117
1117
  return true;
1118
1118
  }
1119
1119
  // Check if element has ignore classes
1120
- if ((_b = this.config.ignoreClasses) === null || _b === void 0 ? void 0 : _b.some(cls => element.classList.contains(cls))) {
1120
+ if ((_b = this.options.ignoreClasses) === null || _b === void 0 ? void 0 : _b.some(cls => element.classList.contains(cls))) {
1121
1121
  return true;
1122
1122
  }
1123
1123
  // Check parent elements for ignore classes
1124
1124
  let parent = element.parentElement;
1125
1125
  while (parent) {
1126
- if ((_c = this.config.ignoreClasses) === null || _c === void 0 ? void 0 : _c.some(cls => parent.classList.contains(cls))) {
1126
+ if ((_c = this.options.ignoreClasses) === null || _c === void 0 ? void 0 : _c.some(cls => parent.classList.contains(cls))) {
1127
1127
  return true;
1128
1128
  }
1129
1129
  parent = parent.parentElement;
@@ -1155,7 +1155,7 @@
1155
1155
  }
1156
1156
  });
1157
1157
  // Element content
1158
- if (this.config.captureContentText) {
1158
+ if (this.options.captureContentText) {
1159
1159
  const text = this.getElementText(element);
1160
1160
  if (text) {
1161
1161
  properties.$element_text = text.substring(0, 200); // Limit text length
@@ -1342,17 +1342,18 @@
1342
1342
  }
1343
1343
  }
1344
1344
 
1345
- class Journium {
1345
+ class JourniumAnalytics {
1346
1346
  constructor(config) {
1347
+ var _a, _b;
1347
1348
  this.config = config;
1348
1349
  this.client = new JourniumClient(config);
1349
1350
  this.pageviewTracker = new PageviewTracker(this.client);
1350
- const autocaptureConfig = this.resolveAutocaptureConfig(config.autocapture);
1351
- this.autocaptureTracker = new AutocaptureTracker(this.client, autocaptureConfig);
1352
- // Store resolved autocapture state for startAutoCapture method
1353
- this.autocaptureEnabled = config.autocapture !== false;
1351
+ const autocaptureOptions = this.resolveAutocaptureOptions((_a = config.options) === null || _a === void 0 ? void 0 : _a.autocapture);
1352
+ this.autocaptureTracker = new AutocaptureTracker(this.client, autocaptureOptions);
1353
+ // Store resolved autocapture state for startAutocapture method
1354
+ this.autocaptureEnabled = ((_b = config.options) === null || _b === void 0 ? void 0 : _b.autocapture) !== false;
1354
1355
  }
1355
- resolveAutocaptureConfig(autocapture) {
1356
+ resolveAutocaptureOptions(autocapture) {
1356
1357
  if (autocapture === false) {
1357
1358
  return {
1358
1359
  captureClicks: false,
@@ -1378,44 +1379,43 @@
1378
1379
  capturePageview(properties) {
1379
1380
  this.pageviewTracker.capturePageview(properties);
1380
1381
  }
1381
- startAutoCapture() {
1382
- this.pageviewTracker.startAutoCapture();
1382
+ startAutocapture() {
1383
+ // Check if automatic pageview tracking is enabled (defaults to true)
1384
+ const effectiveOptions = this.client.getEffectiveOptions();
1385
+ const autoTrackPageviews = effectiveOptions.autoTrackPageviews !== false;
1386
+ if (autoTrackPageviews) {
1387
+ this.pageviewTracker.startAutocapture();
1388
+ }
1383
1389
  if (this.autocaptureEnabled) {
1384
1390
  this.autocaptureTracker.start();
1385
1391
  }
1386
1392
  }
1387
- stopAutoCapture() {
1388
- this.pageviewTracker.stopAutoCapture();
1389
- this.autocaptureTracker.stop();
1390
- }
1391
- // Aliases for consistency (deprecated - use startAutoCapture)
1392
- /** @deprecated Use startAutoCapture() instead */
1393
- startAutocapture() {
1394
- this.startAutoCapture();
1395
- }
1396
- /** @deprecated Use stopAutoCapture() instead */
1397
1393
  stopAutocapture() {
1398
- this.stopAutoCapture();
1394
+ this.pageviewTracker.stopAutocapture();
1395
+ this.autocaptureTracker.stop();
1399
1396
  }
1400
1397
  async flush() {
1401
1398
  return this.client.flush();
1402
1399
  }
1400
+ getEffectiveOptions() {
1401
+ return this.client.getEffectiveOptions();
1402
+ }
1403
1403
  destroy() {
1404
- this.pageviewTracker.stopAutoCapture();
1404
+ this.pageviewTracker.stopAutocapture();
1405
1405
  this.autocaptureTracker.stop();
1406
1406
  this.client.destroy();
1407
1407
  }
1408
1408
  }
1409
1409
  const init = (config) => {
1410
- return new Journium(config);
1410
+ return new JourniumAnalytics(config);
1411
1411
  };
1412
1412
 
1413
1413
  exports.AutocaptureTracker = AutocaptureTracker;
1414
1414
  exports.BrowserIdentityManager = BrowserIdentityManager;
1415
- exports.Journium = Journium;
1415
+ exports.JourniumAnalytics = JourniumAnalytics;
1416
1416
  exports.JourniumClient = JourniumClient;
1417
1417
  exports.PageviewTracker = PageviewTracker;
1418
- exports.fetchRemoteConfig = fetchRemoteConfig;
1418
+ exports.fetchRemoteOptions = fetchRemoteOptions;
1419
1419
  exports.generateId = generateId;
1420
1420
  exports.generateUuidv7 = generateUuidv7;
1421
1421
  exports.getCurrentTimestamp = getCurrentTimestamp;
@@ -1425,7 +1425,7 @@
1425
1425
  exports.init = init;
1426
1426
  exports.isBrowser = isBrowser;
1427
1427
  exports.isNode = isNode;
1428
- exports.mergeConfigs = mergeConfigs;
1428
+ exports.mergeOptions = mergeOptions;
1429
1429
 
1430
1430
  }));
1431
1431
  //# sourceMappingURL=index.umd.js.map