From 6b085934cf1bf8dcf5833450b239db93c0982a32 Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Fri, 14 Jul 2023 15:25:56 -0500 Subject: [PATCH 1/3] wip --- .changeset/nervous-seals-remain.md | 5 +++++ packages/browser/src/browser/index.ts | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 .changeset/nervous-seals-remain.md diff --git a/.changeset/nervous-seals-remain.md b/.changeset/nervous-seals-remain.md new file mode 100644 index 000000000..eb5a4c399 --- /dev/null +++ b/.changeset/nervous-seals-remain.md @@ -0,0 +1,5 @@ +--- +'@segment/analytics-next': patch +--- + +Add consent info to typescript types diff --git a/packages/browser/src/browser/index.ts b/packages/browser/src/browser/index.ts index a0a5d10d2..61072c1f6 100644 --- a/packages/browser/src/browser/index.ts +++ b/packages/browser/src/browser/index.ts @@ -39,6 +39,10 @@ export interface LegacyIntegrationConfiguration { bundlingStatus?: string + consentSettings?: { + categories: string[] + } + // Segment.io specific retryQueue?: boolean @@ -64,6 +68,10 @@ export interface LegacySettings { legacyVideoPluginsEnabled?: boolean remotePlugins?: RemotePlugin[] + + consentSettings?: { + allCategories: string[] + } } export interface AnalyticsBrowserSettings extends AnalyticsSettings { From 3227aa7950353bda462ba90e90cd06aa15bf9a8e Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Fri, 14 Jul 2023 15:29:22 -0500 Subject: [PATCH 2/3] wip --- packages/browser/src/browser/index.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/browser/src/browser/index.ts b/packages/browser/src/browser/index.ts index 61072c1f6..fa773b417 100644 --- a/packages/browser/src/browser/index.ts +++ b/packages/browser/src/browser/index.ts @@ -39,7 +39,14 @@ export interface LegacyIntegrationConfiguration { bundlingStatus?: string + /** + * Consent settings for the integration + */ consentSettings?: { + /** + * Consent categories for the integration + * @example ["Analytics", "Advertising", "CAT001"] + */ categories: string[] } @@ -69,7 +76,17 @@ export interface LegacySettings { remotePlugins?: RemotePlugin[] + /** + * Top level consent settings + */ consentSettings?: { + /** + * All unique consent categories. + * There can be categories that are not included in any integration in the integrations object + * (e.g. 2 cloud mode categories), which is why this is needed. + * + * @example ["Analytics", "Advertising", "CAT001"] + */ allCategories: string[] } } From b6878f613bd1ec5820b69deae35b9ea4b05255da Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Fri, 14 Jul 2023 15:40:59 -0500 Subject: [PATCH 3/3] wip --- packages/browser/src/browser/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/browser/src/browser/index.ts b/packages/browser/src/browser/index.ts index fa773b417..8ee803b3a 100644 --- a/packages/browser/src/browser/index.ts +++ b/packages/browser/src/browser/index.ts @@ -82,9 +82,7 @@ export interface LegacySettings { consentSettings?: { /** * All unique consent categories. - * There can be categories that are not included in any integration in the integrations object - * (e.g. 2 cloud mode categories), which is why this is needed. - * + * There can be categories in this array that are important for consent that are not included in any integration (e.g. 2 cloud mode categories). * @example ["Analytics", "Advertising", "CAT001"] */ allCategories: string[]