@oursprivacy/platform-sdk 1.60.0 → 1.62.0

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.
Files changed (109) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +58 -15
  3. package/client.d.mts +5 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +5 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js +13 -1
  8. package/client.js.map +1 -1
  9. package/client.mjs +13 -1
  10. package/client.mjs.map +1 -1
  11. package/core/error.d.mts.map +1 -1
  12. package/core/error.d.ts.map +1 -1
  13. package/core/error.js +2 -1
  14. package/core/error.js.map +1 -1
  15. package/core/error.mjs +2 -1
  16. package/core/error.mjs.map +1 -1
  17. package/internal/utils/log.d.mts +5 -0
  18. package/internal/utils/log.d.mts.map +1 -1
  19. package/internal/utils/log.d.ts +5 -0
  20. package/internal/utils/log.d.ts.map +1 -1
  21. package/internal/utils/log.js +62 -1
  22. package/internal/utils/log.js.map +1 -1
  23. package/internal/utils/log.mjs +60 -0
  24. package/internal/utils/log.mjs.map +1 -1
  25. package/package.json +1 -10
  26. package/resources/attribution-reports.d.mts +1400 -0
  27. package/resources/attribution-reports.d.mts.map +1 -0
  28. package/resources/attribution-reports.d.ts +1400 -0
  29. package/resources/attribution-reports.d.ts.map +1 -0
  30. package/resources/attribution-reports.js +116 -0
  31. package/resources/attribution-reports.js.map +1 -0
  32. package/resources/attribution-reports.mjs +112 -0
  33. package/resources/attribution-reports.mjs.map +1 -0
  34. package/resources/destinations.d.mts +7 -7
  35. package/resources/destinations.d.mts.map +1 -1
  36. package/resources/destinations.d.ts +7 -7
  37. package/resources/destinations.d.ts.map +1 -1
  38. package/resources/experiment-settings.d.mts +24 -14
  39. package/resources/experiment-settings.d.mts.map +1 -1
  40. package/resources/experiment-settings.d.ts +24 -14
  41. package/resources/experiment-settings.d.ts.map +1 -1
  42. package/resources/experiment-settings.js +8 -4
  43. package/resources/experiment-settings.js.map +1 -1
  44. package/resources/experiment-settings.mjs +8 -4
  45. package/resources/experiment-settings.mjs.map +1 -1
  46. package/resources/experiment-variants.d.mts +84 -93
  47. package/resources/experiment-variants.d.mts.map +1 -1
  48. package/resources/experiment-variants.d.ts +84 -93
  49. package/resources/experiment-variants.d.ts.map +1 -1
  50. package/resources/experiment-variants.js +3 -1
  51. package/resources/experiment-variants.js.map +1 -1
  52. package/resources/experiment-variants.mjs +3 -1
  53. package/resources/experiment-variants.mjs.map +1 -1
  54. package/resources/experiments.d.mts +50 -65
  55. package/resources/experiments.d.mts.map +1 -1
  56. package/resources/experiments.d.ts +50 -65
  57. package/resources/experiments.d.ts.map +1 -1
  58. package/resources/heatmap-pages.d.mts +51 -28
  59. package/resources/heatmap-pages.d.mts.map +1 -1
  60. package/resources/heatmap-pages.d.ts +51 -28
  61. package/resources/heatmap-pages.d.ts.map +1 -1
  62. package/resources/heatmap-pages.js +23 -17
  63. package/resources/heatmap-pages.js.map +1 -1
  64. package/resources/heatmap-pages.mjs +23 -17
  65. package/resources/heatmap-pages.mjs.map +1 -1
  66. package/resources/index.d.mts +2 -1
  67. package/resources/index.d.mts.map +1 -1
  68. package/resources/index.d.ts +2 -1
  69. package/resources/index.d.ts.map +1 -1
  70. package/resources/index.js +3 -1
  71. package/resources/index.js.map +1 -1
  72. package/resources/index.mjs +1 -0
  73. package/resources/index.mjs.map +1 -1
  74. package/resources/test-events.d.mts +6 -0
  75. package/resources/test-events.d.mts.map +1 -1
  76. package/resources/test-events.d.ts +6 -0
  77. package/resources/test-events.d.ts.map +1 -1
  78. package/resources/videos.d.mts +17 -5
  79. package/resources/videos.d.mts.map +1 -1
  80. package/resources/videos.d.ts +17 -5
  81. package/resources/videos.d.ts.map +1 -1
  82. package/resources/videos.js +2 -2
  83. package/resources/videos.mjs +2 -2
  84. package/resources/web-scanners.d.mts +84 -32
  85. package/resources/web-scanners.d.mts.map +1 -1
  86. package/resources/web-scanners.d.ts +84 -32
  87. package/resources/web-scanners.d.ts.map +1 -1
  88. package/resources/web-scanners.js +34 -18
  89. package/resources/web-scanners.js.map +1 -1
  90. package/resources/web-scanners.mjs +34 -18
  91. package/resources/web-scanners.mjs.map +1 -1
  92. package/src/client.ts +59 -0
  93. package/src/core/error.ts +2 -1
  94. package/src/internal/utils/log.ts +64 -0
  95. package/src/resources/attribution-reports.ts +2294 -0
  96. package/src/resources/destinations.ts +9 -2
  97. package/src/resources/experiment-settings.ts +24 -14
  98. package/src/resources/experiment-variants.ts +84 -93
  99. package/src/resources/experiments.ts +50 -65
  100. package/src/resources/heatmap-pages.ts +53 -28
  101. package/src/resources/index.ts +23 -0
  102. package/src/resources/test-events.ts +7 -0
  103. package/src/resources/videos.ts +243 -5
  104. package/src/resources/web-scanners.ts +100 -31
  105. package/src/version.ts +1 -1
  106. package/version.d.mts +1 -1
  107. package/version.d.ts +1 -1
  108. package/version.js +1 -1
  109. package/version.mjs +1 -1
@@ -104,6 +104,7 @@ export interface DestinationListResponse {
104
104
  | 'ActiveCampaignApi'
105
105
  | 'Admitad'
106
106
  | 'AdobeAnalytics'
107
+ | 'Affiliatly'
107
108
  | 'AmazonDSP'
108
109
  | 'Amplitude'
109
110
  | 'AppLovin'
@@ -228,6 +229,7 @@ export interface DestinationCreateResponse {
228
229
  | 'ActiveCampaignApi'
229
230
  | 'Admitad'
230
231
  | 'AdobeAnalytics'
232
+ | 'Affiliatly'
231
233
  | 'AmazonDSP'
232
234
  | 'Amplitude'
233
235
  | 'AppLovin'
@@ -352,6 +354,7 @@ export interface DestinationRetrieveResponse {
352
354
  | 'ActiveCampaignApi'
353
355
  | 'Admitad'
354
356
  | 'AdobeAnalytics'
357
+ | 'Affiliatly'
355
358
  | 'AmazonDSP'
356
359
  | 'Amplitude'
357
360
  | 'AppLovin'
@@ -476,6 +479,7 @@ export interface DestinationUpdateResponse {
476
479
  | 'ActiveCampaignApi'
477
480
  | 'Admitad'
478
481
  | 'AdobeAnalytics'
482
+ | 'Affiliatly'
479
483
  | 'AmazonDSP'
480
484
  | 'Amplitude'
481
485
  | 'AppLovin'
@@ -671,7 +675,8 @@ export namespace DestinationTypesResponse {
671
675
  | 'Fullstory'
672
676
  | 'GravityCAPI'
673
677
  | 'LeadSquared'
674
- | 'Trybe';
678
+ | 'Trybe'
679
+ | 'Affiliatly';
675
680
 
676
681
  capabilities: Entity.Capabilities;
677
682
 
@@ -839,6 +844,7 @@ export interface DestinationListParams extends CursorParams {
839
844
  | 'ActiveCampaignApi'
840
845
  | 'Admitad'
841
846
  | 'AdobeAnalytics'
847
+ | 'Affiliatly'
842
848
  | 'AmazonDSP'
843
849
  | 'Amplitude'
844
850
  | 'AppLovin'
@@ -1022,7 +1028,8 @@ export interface DestinationCreateParams {
1022
1028
  | 'Fullstory'
1023
1029
  | 'GravityCAPI'
1024
1030
  | 'LeadSquared'
1025
- | 'Trybe';
1031
+ | 'Trybe'
1032
+ | 'Affiliatly';
1026
1033
 
1027
1034
  /**
1028
1035
  * Restrict dispatch to these source IDs. Omit on create or send `null` to accept
@@ -60,14 +60,18 @@ export class ExperimentSettings extends APIResource {
60
60
  }
61
61
 
62
62
  /**
63
- * Partially update an experiment settings. Only the fields you send are changed.
64
- * Requires API-key scope or current OAuth user permission:
65
- * experimentSettings:update
63
+ * Partially update an experiment settings record. Only the fields you send change.
64
+ * Discover the ID with GET /rest/v1/experiment-settings. Missing IDs and IDs this
65
+ * credential cannot access return the same 404; returns 403 when Experimentation
66
+ * is disabled for an otherwise authorized record. Requires API-key scope or
67
+ * current OAuth user permission: experimentSettings:update
66
68
  *
67
69
  * @example
68
70
  * ```ts
69
71
  * const experimentSetting =
70
- * await client.experimentSettings.update('id');
72
+ * await client.experimentSettings.update(
73
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
74
+ * );
71
75
  * ```
72
76
  */
73
77
  update(
@@ -388,22 +392,25 @@ export interface ExperimentSettingDeleteResponse {
388
392
  export interface ExperimentSettingCreateParams {
389
393
  /**
390
394
  * Cookie name used to persist sticky variant assignments in the browser. Defaults
391
- * to `_cord_exp` when omitted on create.
395
+ * to `_cord_exp` when omitted on create; omitted or null keeps the saved value on
396
+ * update.
392
397
  */
393
398
  cookieName?: string | null;
394
399
 
395
400
  /**
396
401
  * Human-readable name for this experimentation configuration. Defaults to
397
- * `Experiment Settings` when omitted on create.
402
+ * `Experiment Settings` when omitted on create; omitted or null keeps the saved
403
+ * value on update.
398
404
  */
399
405
  name?: string | null;
400
406
 
401
407
  /**
402
408
  * Limits which domains can load your experiments. When set, experiments using this
403
409
  * settings record are only served on these domains; the SDK refuses to load
404
- * anywhere else and your experiments never run on those hosts. Separate from
405
- * source `whitelistDomains`, which limits which domains can send events to the
406
- * CDP.
410
+ * anywhere else and your experiments never run on those hosts. On update, an empty
411
+ * array clears the allowlist (all domains served), and omitted or null keeps the
412
+ * saved value. Separate from source `whitelistDomains`, which limits which domains
413
+ * can send events to the CDP.
407
414
  */
408
415
  whitelistDomains?: Array<string> | null;
409
416
  }
@@ -411,22 +418,25 @@ export interface ExperimentSettingCreateParams {
411
418
  export interface ExperimentSettingUpdateParams {
412
419
  /**
413
420
  * Cookie name used to persist sticky variant assignments in the browser. Defaults
414
- * to `_cord_exp` when omitted on create.
421
+ * to `_cord_exp` when omitted on create; omitted or null keeps the saved value on
422
+ * update.
415
423
  */
416
424
  cookieName?: string | null;
417
425
 
418
426
  /**
419
427
  * Human-readable name for this experimentation configuration. Defaults to
420
- * `Experiment Settings` when omitted on create.
428
+ * `Experiment Settings` when omitted on create; omitted or null keeps the saved
429
+ * value on update.
421
430
  */
422
431
  name?: string | null;
423
432
 
424
433
  /**
425
434
  * Limits which domains can load your experiments. When set, experiments using this
426
435
  * settings record are only served on these domains; the SDK refuses to load
427
- * anywhere else and your experiments never run on those hosts. Separate from
428
- * source `whitelistDomains`, which limits which domains can send events to the
429
- * CDP.
436
+ * anywhere else and your experiments never run on those hosts. On update, an empty
437
+ * array clears the allowlist (all domains served), and omitted or null keeps the
438
+ * saved value. Separate from source `whitelistDomains`, which limits which domains
439
+ * can send events to the CDP.
430
440
  */
431
441
  whitelistDomains?: Array<string> | null;
432
442
  }
@@ -76,7 +76,9 @@ export class ExperimentVariants extends APIResource {
76
76
  * @example
77
77
  * ```ts
78
78
  * const experimentVariant =
79
- * await client.experimentVariants.update('id');
79
+ * await client.experimentVariants.update(
80
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
81
+ * );
80
82
  * ```
81
83
  */
82
84
  update(
@@ -126,8 +128,8 @@ export interface ExperimentVariantListResponse {
126
128
  name: string;
127
129
 
128
130
  /**
129
- * Relative traffic weight used when assigning visitors among variants in an active
130
- * experiment.
131
+ * Share of the experiment's traffic as a percentage (0–100). Weights across all
132
+ * variants total 100; the control's weight is the remainder after the treatments.
131
133
  */
132
134
  weight: number;
133
135
 
@@ -177,31 +179,28 @@ export namespace ExperimentVariantListResponse {
177
179
  * Canonical action payload. For `setText` / `setHtml` / `customCss` / `customJs` /
178
180
  * `setImage` / `insertBefore` / `insertAfter` this is the literal
179
181
  * text/HTML/CSS/JS/URL. For `setStyle` and `setAttribute` it is a JSON-stringified
180
- * `{key: value}` object — prefer the structured `styles` / `attribute` fields
181
- * below to avoid manual JSON encoding.
182
+ * `{key: value}` object; the structured `styles` / `attribute` fields carry the
183
+ * same data.
182
184
  */
183
185
  value: string;
184
186
 
185
187
  /**
186
- * Populated on read for `setAttribute` modifications, parsed from `value`.
187
- * Customers may also send this field instead of a JSON-stringified `value` on
188
- * write — see `domModificationInputSchema`.
188
+ * Populated on read for `setAttribute` modifications, parsed from `value`. May
189
+ * also be sent instead of a JSON-stringified `value` on write.
189
190
  */
190
191
  attribute?: DomModification.Attribute | null;
191
192
 
192
193
  /**
193
- * Populated on read for `setStyle` modifications, parsed from `value`. Customers
194
- * may also send this field instead of a JSON-stringified `value` on write — see
195
- * `domModificationInputSchema`.
194
+ * Populated on read for `setStyle` modifications, parsed from `value`. May also be
195
+ * sent instead of a JSON-stringified `value` on write.
196
196
  */
197
197
  styles?: Array<DomModification.Style> | null;
198
198
  }
199
199
 
200
200
  export namespace DomModification {
201
201
  /**
202
- * Populated on read for `setAttribute` modifications, parsed from `value`.
203
- * Customers may also send this field instead of a JSON-stringified `value` on
204
- * write — see `domModificationInputSchema`.
202
+ * Populated on read for `setAttribute` modifications, parsed from `value`. May
203
+ * also be sent instead of a JSON-stringified `value` on write.
205
204
  */
206
205
  export interface Attribute {
207
206
  /**
@@ -251,8 +250,8 @@ export interface ExperimentVariantCreateResponse {
251
250
  name: string;
252
251
 
253
252
  /**
254
- * Relative traffic weight used when assigning visitors among variants in an active
255
- * experiment.
253
+ * Share of the experiment's traffic as a percentage (0–100). Weights across all
254
+ * variants total 100; the control's weight is the remainder after the treatments.
256
255
  */
257
256
  weight: number;
258
257
 
@@ -302,31 +301,28 @@ export namespace ExperimentVariantCreateResponse {
302
301
  * Canonical action payload. For `setText` / `setHtml` / `customCss` / `customJs` /
303
302
  * `setImage` / `insertBefore` / `insertAfter` this is the literal
304
303
  * text/HTML/CSS/JS/URL. For `setStyle` and `setAttribute` it is a JSON-stringified
305
- * `{key: value}` object — prefer the structured `styles` / `attribute` fields
306
- * below to avoid manual JSON encoding.
304
+ * `{key: value}` object; the structured `styles` / `attribute` fields carry the
305
+ * same data.
307
306
  */
308
307
  value: string;
309
308
 
310
309
  /**
311
- * Populated on read for `setAttribute` modifications, parsed from `value`.
312
- * Customers may also send this field instead of a JSON-stringified `value` on
313
- * write — see `domModificationInputSchema`.
310
+ * Populated on read for `setAttribute` modifications, parsed from `value`. May
311
+ * also be sent instead of a JSON-stringified `value` on write.
314
312
  */
315
313
  attribute?: DomModification.Attribute | null;
316
314
 
317
315
  /**
318
- * Populated on read for `setStyle` modifications, parsed from `value`. Customers
319
- * may also send this field instead of a JSON-stringified `value` on write — see
320
- * `domModificationInputSchema`.
316
+ * Populated on read for `setStyle` modifications, parsed from `value`. May also be
317
+ * sent instead of a JSON-stringified `value` on write.
321
318
  */
322
319
  styles?: Array<DomModification.Style> | null;
323
320
  }
324
321
 
325
322
  export namespace DomModification {
326
323
  /**
327
- * Populated on read for `setAttribute` modifications, parsed from `value`.
328
- * Customers may also send this field instead of a JSON-stringified `value` on
329
- * write — see `domModificationInputSchema`.
324
+ * Populated on read for `setAttribute` modifications, parsed from `value`. May
325
+ * also be sent instead of a JSON-stringified `value` on write.
330
326
  */
331
327
  export interface Attribute {
332
328
  /**
@@ -376,8 +372,8 @@ export interface ExperimentVariantRetrieveResponse {
376
372
  name: string;
377
373
 
378
374
  /**
379
- * Relative traffic weight used when assigning visitors among variants in an active
380
- * experiment.
375
+ * Share of the experiment's traffic as a percentage (0–100). Weights across all
376
+ * variants total 100; the control's weight is the remainder after the treatments.
381
377
  */
382
378
  weight: number;
383
379
 
@@ -427,31 +423,28 @@ export namespace ExperimentVariantRetrieveResponse {
427
423
  * Canonical action payload. For `setText` / `setHtml` / `customCss` / `customJs` /
428
424
  * `setImage` / `insertBefore` / `insertAfter` this is the literal
429
425
  * text/HTML/CSS/JS/URL. For `setStyle` and `setAttribute` it is a JSON-stringified
430
- * `{key: value}` object — prefer the structured `styles` / `attribute` fields
431
- * below to avoid manual JSON encoding.
426
+ * `{key: value}` object; the structured `styles` / `attribute` fields carry the
427
+ * same data.
432
428
  */
433
429
  value: string;
434
430
 
435
431
  /**
436
- * Populated on read for `setAttribute` modifications, parsed from `value`.
437
- * Customers may also send this field instead of a JSON-stringified `value` on
438
- * write — see `domModificationInputSchema`.
432
+ * Populated on read for `setAttribute` modifications, parsed from `value`. May
433
+ * also be sent instead of a JSON-stringified `value` on write.
439
434
  */
440
435
  attribute?: DomModification.Attribute | null;
441
436
 
442
437
  /**
443
- * Populated on read for `setStyle` modifications, parsed from `value`. Customers
444
- * may also send this field instead of a JSON-stringified `value` on write — see
445
- * `domModificationInputSchema`.
438
+ * Populated on read for `setStyle` modifications, parsed from `value`. May also be
439
+ * sent instead of a JSON-stringified `value` on write.
446
440
  */
447
441
  styles?: Array<DomModification.Style> | null;
448
442
  }
449
443
 
450
444
  export namespace DomModification {
451
445
  /**
452
- * Populated on read for `setAttribute` modifications, parsed from `value`.
453
- * Customers may also send this field instead of a JSON-stringified `value` on
454
- * write — see `domModificationInputSchema`.
446
+ * Populated on read for `setAttribute` modifications, parsed from `value`. May
447
+ * also be sent instead of a JSON-stringified `value` on write.
455
448
  */
456
449
  export interface Attribute {
457
450
  /**
@@ -501,8 +494,8 @@ export interface ExperimentVariantUpdateResponse {
501
494
  name: string;
502
495
 
503
496
  /**
504
- * Relative traffic weight used when assigning visitors among variants in an active
505
- * experiment.
497
+ * Share of the experiment's traffic as a percentage (0–100). Weights across all
498
+ * variants total 100; the control's weight is the remainder after the treatments.
506
499
  */
507
500
  weight: number;
508
501
 
@@ -552,31 +545,28 @@ export namespace ExperimentVariantUpdateResponse {
552
545
  * Canonical action payload. For `setText` / `setHtml` / `customCss` / `customJs` /
553
546
  * `setImage` / `insertBefore` / `insertAfter` this is the literal
554
547
  * text/HTML/CSS/JS/URL. For `setStyle` and `setAttribute` it is a JSON-stringified
555
- * `{key: value}` object — prefer the structured `styles` / `attribute` fields
556
- * below to avoid manual JSON encoding.
548
+ * `{key: value}` object; the structured `styles` / `attribute` fields carry the
549
+ * same data.
557
550
  */
558
551
  value: string;
559
552
 
560
553
  /**
561
- * Populated on read for `setAttribute` modifications, parsed from `value`.
562
- * Customers may also send this field instead of a JSON-stringified `value` on
563
- * write — see `domModificationInputSchema`.
554
+ * Populated on read for `setAttribute` modifications, parsed from `value`. May
555
+ * also be sent instead of a JSON-stringified `value` on write.
564
556
  */
565
557
  attribute?: DomModification.Attribute | null;
566
558
 
567
559
  /**
568
- * Populated on read for `setStyle` modifications, parsed from `value`. Customers
569
- * may also send this field instead of a JSON-stringified `value` on write — see
570
- * `domModificationInputSchema`.
560
+ * Populated on read for `setStyle` modifications, parsed from `value`. May also be
561
+ * sent instead of a JSON-stringified `value` on write.
571
562
  */
572
563
  styles?: Array<DomModification.Style> | null;
573
564
  }
574
565
 
575
566
  export namespace DomModification {
576
567
  /**
577
- * Populated on read for `setAttribute` modifications, parsed from `value`.
578
- * Customers may also send this field instead of a JSON-stringified `value` on
579
- * write — see `domModificationInputSchema`.
568
+ * Populated on read for `setAttribute` modifications, parsed from `value`. May
569
+ * also be sent instead of a JSON-stringified `value` on write.
580
570
  */
581
571
  export interface Attribute {
582
572
  /**
@@ -626,8 +616,8 @@ export interface ExperimentVariantDeleteResponse {
626
616
  name: string;
627
617
 
628
618
  /**
629
- * Relative traffic weight used when assigning visitors among variants in an active
630
- * experiment.
619
+ * Share of the experiment's traffic as a percentage (0–100). Weights across all
620
+ * variants total 100; the control's weight is the remainder after the treatments.
631
621
  */
632
622
  weight: number;
633
623
 
@@ -677,31 +667,28 @@ export namespace ExperimentVariantDeleteResponse {
677
667
  * Canonical action payload. For `setText` / `setHtml` / `customCss` / `customJs` /
678
668
  * `setImage` / `insertBefore` / `insertAfter` this is the literal
679
669
  * text/HTML/CSS/JS/URL. For `setStyle` and `setAttribute` it is a JSON-stringified
680
- * `{key: value}` object — prefer the structured `styles` / `attribute` fields
681
- * below to avoid manual JSON encoding.
670
+ * `{key: value}` object; the structured `styles` / `attribute` fields carry the
671
+ * same data.
682
672
  */
683
673
  value: string;
684
674
 
685
675
  /**
686
- * Populated on read for `setAttribute` modifications, parsed from `value`.
687
- * Customers may also send this field instead of a JSON-stringified `value` on
688
- * write — see `domModificationInputSchema`.
676
+ * Populated on read for `setAttribute` modifications, parsed from `value`. May
677
+ * also be sent instead of a JSON-stringified `value` on write.
689
678
  */
690
679
  attribute?: DomModification.Attribute | null;
691
680
 
692
681
  /**
693
- * Populated on read for `setStyle` modifications, parsed from `value`. Customers
694
- * may also send this field instead of a JSON-stringified `value` on write — see
695
- * `domModificationInputSchema`.
682
+ * Populated on read for `setStyle` modifications, parsed from `value`. May also be
683
+ * sent instead of a JSON-stringified `value` on write.
696
684
  */
697
685
  styles?: Array<DomModification.Style> | null;
698
686
  }
699
687
 
700
688
  export namespace DomModification {
701
689
  /**
702
- * Populated on read for `setAttribute` modifications, parsed from `value`.
703
- * Customers may also send this field instead of a JSON-stringified `value` on
704
- * write — see `domModificationInputSchema`.
690
+ * Populated on read for `setAttribute` modifications, parsed from `value`. May
691
+ * also be sent instead of a JSON-stringified `value` on write.
705
692
  */
706
693
  export interface Attribute {
707
694
  /**
@@ -748,12 +735,12 @@ export interface ExperimentVariantCreateParams {
748
735
  name: string;
749
736
 
750
737
  /**
751
- * Traffic weight for this variant as a percentage (0–100). Treatment weights are
752
- * percentages of the split and must total 99% or less to leave room for the
753
- * auto-created control; the control is the remainder (100 − Σ treatment weights,
754
- * always ≥ 1%). A personalization experience always serves its first non-control
755
- * treatment to matching visitors, regardless of traffic allocation or variant
756
- * weights.
738
+ * This treatment's share of the experiment's traffic as a whole-number percentage
739
+ * (0–100), not a relative weight. Treatment weights must total 99 or less; the
740
+ * auto-created control receives the remainder (100 − the treatment total, always
741
+ * at least 1). For a 50/50 test, send `weight: 50`. A personalization experience
742
+ * always serves its first non-control treatment to matching visitors, regardless
743
+ * of traffic allocation or variant weights.
757
744
  */
758
745
  weight: number;
759
746
 
@@ -764,12 +751,10 @@ export interface ExperimentVariantCreateParams {
764
751
  domModifications?: Array<ExperimentVariantCreateParams.DomModification> | null;
765
752
 
766
753
  /**
767
- * Mark this variant as the experiment control. Defaults to `false`. The API
768
- * rejects the request with 409 if the experiment already has a control variant.
769
- * Every experiment keeps exactly one control whose weight is the auto-derived
770
- * remainder of the split, so the control cannot be cleared while it would leave
771
- * the treatments at 100% (no room for a control). DELETE on the control
772
- * returns 409.
754
+ * Mark this variant as the experiment control. Defaults to `false`. Every
755
+ * experiment already has an auto-created control that cannot be demoted or
756
+ * deleted, so creating a second control is rejected with 409; edit the existing
757
+ * control instead.
773
758
  */
774
759
  isControl?: boolean | null;
775
760
 
@@ -838,8 +823,8 @@ export namespace ExperimentVariantCreateParams {
838
823
  * Canonical action payload. For `setText` / `setHtml` / `customCss` / `customJs` /
839
824
  * `setImage` / `insertBefore` / `insertAfter` this is the literal
840
825
  * text/HTML/CSS/JS/URL. For `setStyle` and `setAttribute` it is a JSON-stringified
841
- * `{key: value}` object — or you can supply the structured `styles` / `attribute`
842
- * field instead and the server will normalize.
826
+ * `{key: value}` object — or supply the structured `styles` / `attribute` field
827
+ * instead and the server will normalize.
843
828
  */
844
829
  value?: string | null;
845
830
  }
@@ -883,10 +868,9 @@ export interface ExperimentVariantUpdateParams {
883
868
  domModifications?: Array<ExperimentVariantUpdateParams.DomModification> | null;
884
869
 
885
870
  /**
886
- * Promote or demote this variant as the control. Promoting a second variant while
887
- * another already has `isControl: true` is rejected with 409. Demoting the control
888
- * (`isControl: false`) is rejected — an experiment must always keep a control.
889
- * Null leaves the control flag unchanged.
871
+ * Promote this variant to control. Rejected with 409 while another variant is the
872
+ * control, and demoting the control (`false`) is rejected because an experiment
873
+ * must always keep one. Null leaves the control flag unchanged.
890
874
  */
891
875
  isControl?: boolean | null;
892
876
 
@@ -903,17 +887,24 @@ export interface ExperimentVariantUpdateParams {
903
887
  redirectUrl?: string | null;
904
888
 
905
889
  /**
906
- * Updated variant delivery mechanism. `dom_modifications` mutates the current page
907
- * in-place; `redirect` sends the visitor to a different URL — pick based on
908
- * whether the _page_ or the _content_ is the variable. Changing this also requires
909
- * updating the matching payload field (`redirectUrl` or `domModifications`).
890
+ * Updated delivery mechanism. Variant delivery mechanism. `dom_modifications`
891
+ * mutates the current page in-place at SDK runtime — use it for
892
+ * copy/style/image/HTML changes that keep visitors on the same URL (headline copy
893
+ * tests, button color, hero image swap). `redirect` routes the visitor to a
894
+ * different URL entirely — use it for landing-page A/B tests, alternate pricing
895
+ * pages, or any test where the _page itself_ is the variable. They are not
896
+ * interchangeable: a redirect variant cannot also tweak DOM, and a
897
+ * dom_modifications variant cannot send the visitor elsewhere. Changing this also
898
+ * requires updating the matching payload field (`redirectUrl` or
899
+ * `domModifications`).
910
900
  */
911
901
  variantType?: 'dom_modifications' | 'redirect' | null;
912
902
 
913
903
  /**
914
- * Updated traffic weight as a percentage (0–100). The control variant weight is
915
- * derived from the treatments (it is the remainder of the split) and cannot be set
916
- * directly.
904
+ * Updated share of the experiment's traffic as a whole-number percentage (0–100),
905
+ * not a relative weight. Treatment weights must total 99 or less. The control's
906
+ * weight is the remainder of the split and cannot be set directly; change a
907
+ * treatment instead. Omitted or null keeps the saved weight.
917
908
  */
918
909
  weight?: number | null;
919
910
  }
@@ -963,8 +954,8 @@ export namespace ExperimentVariantUpdateParams {
963
954
  * Canonical action payload. For `setText` / `setHtml` / `customCss` / `customJs` /
964
955
  * `setImage` / `insertBefore` / `insertAfter` this is the literal
965
956
  * text/HTML/CSS/JS/URL. For `setStyle` and `setAttribute` it is a JSON-stringified
966
- * `{key: value}` object — or you can supply the structured `styles` / `attribute`
967
- * field instead and the server will normalize.
957
+ * `{key: value}` object — or supply the structured `styles` / `attribute` field
958
+ * instead and the server will normalize.
968
959
  */
969
960
  value?: string | null;
970
961
  }