@coframe/sdk 1.1.50 → 1.1.53

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.
@@ -4794,9 +4794,7 @@ function configureReplayScriptUrl(url) {
4794
4794
  replayScriptUrl = (url === null || url === void 0 ? void 0 : url.trim()) || undefined;
4795
4795
  }
4796
4796
  function isOptOut(settings) {
4797
- return (settings.consent_model === 'opt_out' ||
4798
- (settings.consent_model === undefined &&
4799
- settings.consent_required === false));
4797
+ return settings.consent_model === 'opt_out';
4800
4798
  }
4801
4799
  function readReplayConsent(settings) {
4802
4800
  try {
@@ -4808,6 +4806,14 @@ function readReplayConsent(settings) {
4808
4806
  if (shopify === undefined) {
4809
4807
  if (readUsPrivacy() === 'denied')
4810
4808
  return { state: 'denied', reason: 'consent_denied' };
4809
+ if (isWaitingForCookies()) {
4810
+ const signal = readClientCommand();
4811
+ if (signal === 'granted')
4812
+ return { state: 'allowed', source: 'client' };
4813
+ if (signal === 'denied')
4814
+ return { state: 'denied', reason: 'consent_denied' };
4815
+ return { state: 'pending', detected: true };
4816
+ }
4811
4817
  const readers = [
4812
4818
  [readClientCommand, 'client'],
4813
4819
  [readOneTrust, 'onetrust'],
@@ -4792,9 +4792,7 @@ function configureReplayScriptUrl(url) {
4792
4792
  replayScriptUrl = (url === null || url === void 0 ? void 0 : url.trim()) || undefined;
4793
4793
  }
4794
4794
  function isOptOut(settings) {
4795
- return (settings.consent_model === 'opt_out' ||
4796
- (settings.consent_model === undefined &&
4797
- settings.consent_required === false));
4795
+ return settings.consent_model === 'opt_out';
4798
4796
  }
4799
4797
  function readReplayConsent(settings) {
4800
4798
  try {
@@ -4806,6 +4804,14 @@ function readReplayConsent(settings) {
4806
4804
  if (shopify === undefined) {
4807
4805
  if (readUsPrivacy() === 'denied')
4808
4806
  return { state: 'denied', reason: 'consent_denied' };
4807
+ if (isWaitingForCookies()) {
4808
+ const signal = readClientCommand();
4809
+ if (signal === 'granted')
4810
+ return { state: 'allowed', source: 'client' };
4811
+ if (signal === 'denied')
4812
+ return { state: 'denied', reason: 'consent_denied' };
4813
+ return { state: 'pending', detected: true };
4814
+ }
4809
4815
  const readers = [
4810
4816
  [readClientCommand, 'client'],
4811
4817
  [readOneTrust, 'onetrust'],
@@ -82,7 +82,6 @@ interface SessionReplaySettings {
82
82
  url_deny_patterns: string[];
83
83
  url_allow_patterns?: string[];
84
84
  consent_model?: 'opt_in' | 'opt_out';
85
- consent_required?: boolean;
86
85
  max_session_minutes: number;
87
86
  max_session_bytes: number;
88
87
  }
@@ -102,7 +102,6 @@ interface SessionReplaySettings {
102
102
  url_deny_patterns: string[];
103
103
  url_allow_patterns?: string[];
104
104
  consent_model?: 'opt_in' | 'opt_out';
105
- consent_required?: boolean;
106
105
  max_session_minutes: number;
107
106
  max_session_bytes: number;
108
107
  }
@@ -82,7 +82,6 @@ interface SessionReplaySettings {
82
82
  url_deny_patterns: string[];
83
83
  url_allow_patterns?: string[];
84
84
  consent_model?: 'opt_in' | 'opt_out';
85
- consent_required?: boolean;
86
85
  max_session_minutes: number;
87
86
  max_session_bytes: number;
88
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coframe/sdk",
3
- "version": "1.1.50",
3
+ "version": "1.1.53",
4
4
  "description": "Coframe optimizes your website using generative AI to deliver maximum impact to your audience and allow your site to improve itself as you sleep. Learn more at coframe.com.",
5
5
  "main": "dist/pkg/cf.cjs.js",
6
6
  "module": "dist/pkg/cf.esm.mjs",