@grainql/analytics-web 3.0.1 → 3.0.3

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.js CHANGED
@@ -98,7 +98,7 @@ class GrainAnalytics {
98
98
  configRefreshInterval: 300000, // 5 minutes
99
99
  enableConfigCache: true,
100
100
  // Privacy defaults (v2.0)
101
- consentMode: 'cookieless', // Default: privacy-first, no permanent tracking
101
+ consentMode: 'COOKIELESS', // Default: privacy-first, no permanent tracking
102
102
  waitForConsent: false,
103
103
  disableAutoProperties: false,
104
104
  // Automatic Tracking defaults
@@ -191,7 +191,7 @@ class GrainAnalytics {
191
191
  */
192
192
  shouldAllowPersistentStorage() {
193
193
  const hasConsent = this.consentManager.hasConsent('analytics');
194
- const isCookieless = this.config.consentMode === 'cookieless';
194
+ const isCookieless = this.config.consentMode === 'COOKIELESS';
195
195
  const userExplicitlyIdentified = !!this.globalUserId;
196
196
  const isJWTAuth = this.config.authStrategy === 'JWT';
197
197
  // Never allow persistent storage in cookieless mode
@@ -1085,7 +1085,7 @@ class GrainAnalytics {
1085
1085
  this.log(`Event waiting for consent: ${event.eventName}`, event.properties);
1086
1086
  return;
1087
1087
  }
1088
- // v2.0: GDPR Strict falls back to cookie-less mode (daily rotating IDs)
1088
+ // v2.0: GDPR Strict falls back to cookieless mode (daily rotating IDs)
1089
1089
  // Events are never blocked - IdManager already provides correct ID (daily or permanent)
1090
1090
  const hasConsent = this.consentManager.hasConsent('analytics');
1091
1091
  // Add tracking flags to indicate consent status
@@ -1782,7 +1782,7 @@ class GrainAnalytics {
1782
1782
  // Privacy & Consent Methods
1783
1783
  /**
1784
1784
  * Grant consent for tracking (v2.0)
1785
- * Switches from cookie-less mode to permanent IDs
1785
+ * Switches from cookieless mode to permanent IDs
1786
1786
  * @param categories - Optional array of consent categories (e.g., ['analytics', 'functional'])
1787
1787
  */
1788
1788
  grantConsent(categories) {
@@ -1807,7 +1807,7 @@ class GrainAnalytics {
1807
1807
  }
1808
1808
  /**
1809
1809
  * Revoke consent for tracking (v2.0)
1810
- * Switches from permanent IDs to cookie-less mode
1810
+ * Switches from permanent IDs to cookieless mode
1811
1811
  * @param categories - Optional array of categories to revoke (if not provided, revokes all)
1812
1812
  */
1813
1813
  revokeConsent(categories) {
@@ -1816,7 +1816,7 @@ class GrainAnalytics {
1816
1816
  // Sync ID manager with consent state
1817
1817
  const idMode = this.consentManager.getIdMode();
1818
1818
  this.idManager.setMode(idMode);
1819
- this.log('Consent revoked, switched to cookie-less mode', categories);
1819
+ this.log('Consent revoked, switched to cookieless mode', categories);
1820
1820
  // Clear queued events when consent is fully revoked
1821
1821
  if (!this.consentManager.hasConsent()) {
1822
1822
  this.eventQueue = [];
package/dist/index.mjs CHANGED
@@ -57,7 +57,7 @@ export class GrainAnalytics {
57
57
  configRefreshInterval: 300000, // 5 minutes
58
58
  enableConfigCache: true,
59
59
  // Privacy defaults (v2.0)
60
- consentMode: 'cookieless', // Default: privacy-first, no permanent tracking
60
+ consentMode: 'COOKIELESS', // Default: privacy-first, no permanent tracking
61
61
  waitForConsent: false,
62
62
  disableAutoProperties: false,
63
63
  // Automatic Tracking defaults
@@ -150,7 +150,7 @@ export class GrainAnalytics {
150
150
  */
151
151
  shouldAllowPersistentStorage() {
152
152
  const hasConsent = this.consentManager.hasConsent('analytics');
153
- const isCookieless = this.config.consentMode === 'cookieless';
153
+ const isCookieless = this.config.consentMode === 'COOKIELESS';
154
154
  const userExplicitlyIdentified = !!this.globalUserId;
155
155
  const isJWTAuth = this.config.authStrategy === 'JWT';
156
156
  // Never allow persistent storage in cookieless mode
@@ -1044,7 +1044,7 @@ export class GrainAnalytics {
1044
1044
  this.log(`Event waiting for consent: ${event.eventName}`, event.properties);
1045
1045
  return;
1046
1046
  }
1047
- // v2.0: GDPR Strict falls back to cookie-less mode (daily rotating IDs)
1047
+ // v2.0: GDPR Strict falls back to cookieless mode (daily rotating IDs)
1048
1048
  // Events are never blocked - IdManager already provides correct ID (daily or permanent)
1049
1049
  const hasConsent = this.consentManager.hasConsent('analytics');
1050
1050
  // Add tracking flags to indicate consent status
@@ -1741,7 +1741,7 @@ export class GrainAnalytics {
1741
1741
  // Privacy & Consent Methods
1742
1742
  /**
1743
1743
  * Grant consent for tracking (v2.0)
1744
- * Switches from cookie-less mode to permanent IDs
1744
+ * Switches from cookieless mode to permanent IDs
1745
1745
  * @param categories - Optional array of consent categories (e.g., ['analytics', 'functional'])
1746
1746
  */
1747
1747
  grantConsent(categories) {
@@ -1766,7 +1766,7 @@ export class GrainAnalytics {
1766
1766
  }
1767
1767
  /**
1768
1768
  * Revoke consent for tracking (v2.0)
1769
- * Switches from permanent IDs to cookie-less mode
1769
+ * Switches from permanent IDs to cookieless mode
1770
1770
  * @param categories - Optional array of categories to revoke (if not provided, revokes all)
1771
1771
  */
1772
1772
  revokeConsent(categories) {
@@ -1775,7 +1775,7 @@ export class GrainAnalytics {
1775
1775
  // Sync ID manager with consent state
1776
1776
  const idMode = this.consentManager.getIdMode();
1777
1777
  this.idManager.setMode(idMode);
1778
- this.log('Consent revoked, switched to cookie-less mode', categories);
1778
+ this.log('Consent revoked, switched to cookieless mode', categories);
1779
1779
  // Clear queued events when consent is fully revoked
1780
1780
  if (!this.consentManager.hasConsent()) {
1781
1781
  this.eventQueue = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grainql/analytics-web",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "Lightweight TypeScript SDK for sending analytics events and managing remote configurations via Grain's REST API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",