From 9c8b609f500d2338fdbf2572639241ffdfd27f8f Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Sun, 16 Jul 2023 11:36:50 -0500 Subject: [PATCH] Update typescript types to include consent settings (#900) --- .changeset/nervous-seals-remain.md | 5 +++++ packages/browser/src/browser/index.ts | 23 +++++++++++++++++++++++ 2 files changed, 28 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..8ee803b3a 100644 --- a/packages/browser/src/browser/index.ts +++ b/packages/browser/src/browser/index.ts @@ -39,6 +39,17 @@ export interface LegacyIntegrationConfiguration { bundlingStatus?: string + /** + * Consent settings for the integration + */ + consentSettings?: { + /** + * Consent categories for the integration + * @example ["Analytics", "Advertising", "CAT001"] + */ + categories: string[] + } + // Segment.io specific retryQueue?: boolean @@ -64,6 +75,18 @@ export interface LegacySettings { legacyVideoPluginsEnabled?: boolean remotePlugins?: RemotePlugin[] + + /** + * Top level consent settings + */ + consentSettings?: { + /** + * All unique consent categories. + * 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[] + } } export interface AnalyticsBrowserSettings extends AnalyticsSettings {