Skip to content

Commit 9c8b609

Browse files
authored
Update typescript types to include consent settings (#900)
1 parent 6789f9b commit 9c8b609

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.changeset/nervous-seals-remain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@segment/analytics-next': patch
3+
---
4+
5+
Add consent info to typescript types

packages/browser/src/browser/index.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ export interface LegacyIntegrationConfiguration {
3939

4040
bundlingStatus?: string
4141

42+
/**
43+
* Consent settings for the integration
44+
*/
45+
consentSettings?: {
46+
/**
47+
* Consent categories for the integration
48+
* @example ["Analytics", "Advertising", "CAT001"]
49+
*/
50+
categories: string[]
51+
}
52+
4253
// Segment.io specific
4354
retryQueue?: boolean
4455

@@ -64,6 +75,18 @@ export interface LegacySettings {
6475
legacyVideoPluginsEnabled?: boolean
6576

6677
remotePlugins?: RemotePlugin[]
78+
79+
/**
80+
* Top level consent settings
81+
*/
82+
consentSettings?: {
83+
/**
84+
* All unique consent categories.
85+
* 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).
86+
* @example ["Analytics", "Advertising", "CAT001"]
87+
*/
88+
allCategories: string[]
89+
}
6790
}
6891

6992
export interface AnalyticsBrowserSettings extends AnalyticsSettings {

0 commit comments

Comments
 (0)