@oursprivacy/platform-sdk 1.15.1 → 1.16.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 (59) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/destinations.d.mts +5 -5
  10. package/resources/destinations.d.mts.map +1 -1
  11. package/resources/destinations.d.ts +5 -5
  12. package/resources/destinations.d.ts.map +1 -1
  13. package/resources/experiment-settings.d.mts +35 -21
  14. package/resources/experiment-settings.d.mts.map +1 -1
  15. package/resources/experiment-settings.d.ts +35 -21
  16. package/resources/experiment-settings.d.ts.map +1 -1
  17. package/resources/experiment-variants.d.mts +28 -7
  18. package/resources/experiment-variants.d.mts.map +1 -1
  19. package/resources/experiment-variants.d.ts +28 -7
  20. package/resources/experiment-variants.d.ts.map +1 -1
  21. package/resources/experiments.d.mts +160 -17
  22. package/resources/experiments.d.mts.map +1 -1
  23. package/resources/experiments.d.ts +160 -17
  24. package/resources/experiments.d.ts.map +1 -1
  25. package/resources/experiments.js +25 -2
  26. package/resources/experiments.js.map +1 -1
  27. package/resources/experiments.mjs +25 -2
  28. package/resources/experiments.mjs.map +1 -1
  29. package/resources/index.d.mts +1 -1
  30. package/resources/index.d.mts.map +1 -1
  31. package/resources/index.d.ts +1 -1
  32. package/resources/index.d.ts.map +1 -1
  33. package/resources/index.js.map +1 -1
  34. package/resources/index.mjs.map +1 -1
  35. package/resources/sources.d.mts +6 -8
  36. package/resources/sources.d.mts.map +1 -1
  37. package/resources/sources.d.ts +6 -8
  38. package/resources/sources.d.ts.map +1 -1
  39. package/resources/versions.d.mts +24 -8
  40. package/resources/versions.d.mts.map +1 -1
  41. package/resources/versions.d.ts +24 -8
  42. package/resources/versions.d.ts.map +1 -1
  43. package/resources/versions.js +24 -8
  44. package/resources/versions.js.map +1 -1
  45. package/resources/versions.mjs +24 -8
  46. package/resources/versions.mjs.map +1 -1
  47. package/src/client.ts +4 -0
  48. package/src/resources/destinations.ts +5 -0
  49. package/src/resources/experiment-settings.ts +35 -21
  50. package/src/resources/experiment-variants.ts +28 -7
  51. package/src/resources/experiments.ts +182 -16
  52. package/src/resources/index.ts +2 -0
  53. package/src/resources/sources.ts +6 -8
  54. package/src/resources/versions.ts +24 -8
  55. package/src/version.ts +1 -1
  56. package/version.d.mts +1 -1
  57. package/version.d.ts +1 -1
  58. package/version.js +1 -1
  59. package/version.mjs +1 -1
@@ -132,9 +132,11 @@ export namespace ExperimentSettingListResponse {
132
132
  updatedByUserId?: string | null;
133
133
 
134
134
  /**
135
- * Optional domain allowlist for experiment SDK delivery. When set, experiments
136
- * using this settings record are only served on these domains. This is separate
137
- * from source `whitelistDomains`, which gates source event ingestion.
135
+ * Limits which domains can load your experiments. When set, experiments using this
136
+ * settings record are only served on these domains; the SDK refuses to load
137
+ * anywhere else and your experiments never run on those hosts. Separate from
138
+ * source `whitelistDomains`, which limits which domains can send events to the
139
+ * CDP.
138
140
  */
139
141
  whitelistDomains?: Array<string> | null;
140
142
  }
@@ -176,9 +178,11 @@ export interface ExperimentSettingCreateResponse {
176
178
  updatedByUserId?: string | null;
177
179
 
178
180
  /**
179
- * Optional domain allowlist for experiment SDK delivery. When set, experiments
180
- * using this settings record are only served on these domains. This is separate
181
- * from source `whitelistDomains`, which gates source event ingestion.
181
+ * Limits which domains can load your experiments. When set, experiments using this
182
+ * settings record are only served on these domains; the SDK refuses to load
183
+ * anywhere else and your experiments never run on those hosts. Separate from
184
+ * source `whitelistDomains`, which limits which domains can send events to the
185
+ * CDP.
182
186
  */
183
187
  whitelistDomains?: Array<string> | null;
184
188
  }
@@ -219,9 +223,11 @@ export interface ExperimentSettingRetrieveResponse {
219
223
  updatedByUserId?: string | null;
220
224
 
221
225
  /**
222
- * Optional domain allowlist for experiment SDK delivery. When set, experiments
223
- * using this settings record are only served on these domains. This is separate
224
- * from source `whitelistDomains`, which gates source event ingestion.
226
+ * Limits which domains can load your experiments. When set, experiments using this
227
+ * settings record are only served on these domains; the SDK refuses to load
228
+ * anywhere else and your experiments never run on those hosts. Separate from
229
+ * source `whitelistDomains`, which limits which domains can send events to the
230
+ * CDP.
225
231
  */
226
232
  whitelistDomains?: Array<string> | null;
227
233
  }
@@ -262,9 +268,11 @@ export interface ExperimentSettingUpdateResponse {
262
268
  updatedByUserId?: string | null;
263
269
 
264
270
  /**
265
- * Optional domain allowlist for experiment SDK delivery. When set, experiments
266
- * using this settings record are only served on these domains. This is separate
267
- * from source `whitelistDomains`, which gates source event ingestion.
271
+ * Limits which domains can load your experiments. When set, experiments using this
272
+ * settings record are only served on these domains; the SDK refuses to load
273
+ * anywhere else and your experiments never run on those hosts. Separate from
274
+ * source `whitelistDomains`, which limits which domains can send events to the
275
+ * CDP.
268
276
  */
269
277
  whitelistDomains?: Array<string> | null;
270
278
  }
@@ -305,9 +313,11 @@ export interface ExperimentSettingDeleteResponse {
305
313
  updatedByUserId?: string | null;
306
314
 
307
315
  /**
308
- * Optional domain allowlist for experiment SDK delivery. When set, experiments
309
- * using this settings record are only served on these domains. This is separate
310
- * from source `whitelistDomains`, which gates source event ingestion.
316
+ * Limits which domains can load your experiments. When set, experiments using this
317
+ * settings record are only served on these domains; the SDK refuses to load
318
+ * anywhere else and your experiments never run on those hosts. Separate from
319
+ * source `whitelistDomains`, which limits which domains can send events to the
320
+ * CDP.
311
321
  */
312
322
  whitelistDomains?: Array<string> | null;
313
323
  }
@@ -326,9 +336,11 @@ export interface ExperimentSettingCreateParams {
326
336
  name?: string | null;
327
337
 
328
338
  /**
329
- * Optional domain allowlist for experiment SDK delivery. When set, experiments
330
- * using this settings record are only served on these domains. This is separate
331
- * from source `whitelistDomains`, which gates CDP event ingestion.
339
+ * Limits which domains can load your experiments. When set, experiments using this
340
+ * settings record are only served on these domains; the SDK refuses to load
341
+ * anywhere else and your experiments never run on those hosts. Separate from
342
+ * source `whitelistDomains`, which limits which domains can send events to the
343
+ * CDP.
332
344
  */
333
345
  whitelistDomains?: Array<string> | null;
334
346
  }
@@ -347,9 +359,11 @@ export interface ExperimentSettingUpdateParams {
347
359
  name?: string | null;
348
360
 
349
361
  /**
350
- * Optional domain allowlist for experiment SDK delivery. When set, experiments
351
- * using this settings record are only served on these domains. This is separate
352
- * from source `whitelistDomains`, which gates CDP event ingestion.
362
+ * Limits which domains can load your experiments. When set, experiments using this
363
+ * settings record are only served on these domains; the SDK refuses to load
364
+ * anywhere else and your experiments never run on those hosts. Separate from
365
+ * source `whitelistDomains`, which limits which domains can send events to the
366
+ * CDP.
353
367
  */
354
368
  whitelistDomains?: Array<string> | null;
355
369
  }
@@ -689,8 +689,14 @@ export interface ExperimentVariantCreateParams {
689
689
  redirectUrl?: string | null;
690
690
 
691
691
  /**
692
- * Variant type to create. Use `redirect` for redirect tests or `dom_modifications`
693
- * for on-page changes.
692
+ * Variant delivery mechanism. `dom_modifications` mutates the current page
693
+ * in-place at SDK runtime — use it for copy/style/image/HTML changes that keep
694
+ * visitors on the same URL (headline copy tests, button color, hero image swap).
695
+ * `redirect` routes the visitor to a different URL entirely — use it for
696
+ * landing-page A/B tests, alternate pricing pages, or any test where the _page
697
+ * itself_ is the variable. They are not interchangeable: a redirect variant cannot
698
+ * also tweak DOM, and a dom_modifications variant cannot send the visitor
699
+ * elsewhere.
694
700
  */
695
701
  variantType?: 'dom_modifications' | 'redirect' | null;
696
702
  }
@@ -713,7 +719,14 @@ export namespace ExperimentVariantCreateParams {
713
719
  | 'setText';
714
720
 
715
721
  /**
716
- * CSS selector used to find the element to modify on the page at runtime.
722
+ * CSS selector for the element to modify at runtime. PREFER specific selectors
723
+ * that match exactly one element: an `id` (`#hero-headline`), a stable `data-*`
724
+ * attribute (`[data-testid="hero-headline"]`), or a unique class/structural chain
725
+ * (`section.hero > h1.headline`). AVOID bare tag selectors like `h1`, `button`, or
726
+ * `img` — modern pages usually contain several, and the runtime applies the
727
+ * mutation to ONLY THE FIRST match, which silently picks the wrong element. If you
728
+ * only have a tag name, scope it with the nearest unique ancestor (e.g. `main h1`,
729
+ * `header nav a:first-of-type`).
717
730
  */
718
731
  selector: string;
719
732
 
@@ -781,9 +794,10 @@ export interface ExperimentVariantUpdateParams {
781
794
  redirectUrl?: string | null;
782
795
 
783
796
  /**
784
- * Updated variant type — `redirect` or `dom_modifications`. Changing this also
785
- * requires updating the matching payload field (`redirectUrl` or
786
- * `domModifications`).
797
+ * Updated variant delivery mechanism. `dom_modifications` mutates the current page
798
+ * in-place; `redirect` sends the visitor to a different URL — pick based on
799
+ * whether the _page_ or the _content_ is the variable. Changing this also requires
800
+ * updating the matching payload field (`redirectUrl` or `domModifications`).
787
801
  */
788
802
  variantType?: 'dom_modifications' | 'redirect' | null;
789
803
 
@@ -812,7 +826,14 @@ export namespace ExperimentVariantUpdateParams {
812
826
  | 'setText';
813
827
 
814
828
  /**
815
- * CSS selector used to find the element to modify on the page at runtime.
829
+ * CSS selector for the element to modify at runtime. PREFER specific selectors
830
+ * that match exactly one element: an `id` (`#hero-headline`), a stable `data-*`
831
+ * attribute (`[data-testid="hero-headline"]`), or a unique class/structural chain
832
+ * (`section.hero > h1.headline`). AVOID bare tag selectors like `h1`, `button`, or
833
+ * `img` — modern pages usually contain several, and the runtime applies the
834
+ * mutation to ONLY THE FIRST match, which silently picks the wrong element. If you
835
+ * only have a tag name, scope it with the nearest unique ancestor (e.g. `main h1`,
836
+ * `header nav a:first-of-type`).
816
837
  */
817
838
  selector: string;
818
839
 
@@ -93,8 +93,13 @@ export class Experiments extends APIResource {
93
93
  }
94
94
 
95
95
  /**
96
- * Start an experiment. The request body is optional — send `{}` to use defaults.
97
- * Requires scope: experiment:start
96
+ * Start an experiment. By default also publishes the experiment and its variants
97
+ * atomically as a new version, making them live for end users — this is the
98
+ * canonical publish path for experiment changes. They do NOT flow through
99
+ * `POST /rest/v1/versions`. Pass `{ "publishAfterStart": false }` only if a
100
+ * separate publish is desired (e.g. bundling with non-experiment edits via a
101
+ * manual `POST /rest/v1/versions` afterwards). The request body is optional — send
102
+ * `{}` to use defaults. Requires scope: experiment:start
98
103
  *
99
104
  * @example
100
105
  * ```ts
@@ -203,6 +208,29 @@ export class Experiments extends APIResource {
203
208
  ): APIPromise<ExperimentResultsTimeSeriesResponse> {
204
209
  return this._client.get(path`/rest/v1/experiments/${id}/results-time-series`, { query, ...options });
205
210
  }
211
+
212
+ /**
213
+ * List session replays for sessions in which the `$experiment_impression` event
214
+ * fired for this experiment. Each row is one session with the variant the visitor
215
+ * was assigned for that impression. Sessions are ordered newest first by session
216
+ * start. Filter to one variant with `variant_id`. Cursor pagination via `limit`
217
+ * (1–100, default 25) and `cursor`; malformed cursors return 400. Requires scope:
218
+ * experiment:find
219
+ *
220
+ * @example
221
+ * ```ts
222
+ * const response = await client.experiments.sessionReplays(
223
+ * 'id',
224
+ * );
225
+ * ```
226
+ */
227
+ sessionReplays(
228
+ id: string,
229
+ query: ExperimentSessionReplaysParams | null | undefined = {},
230
+ options?: RequestOptions,
231
+ ): APIPromise<ExperimentSessionReplaysResponse> {
232
+ return this._client.get(path`/rest/v1/experiments/${id}/session-replays`, { query, ...options });
233
+ }
206
234
  }
207
235
 
208
236
  export type ExperimentListResponsesCursor = Cursor<ExperimentListResponse>;
@@ -336,7 +364,12 @@ export namespace ExperimentListResponse {
336
364
  /**
337
365
  * Glob-style URL patterns that must match for the experiment to be eligible. Up to
338
366
  * 200 patterns; each pattern up to 2000 characters. An empty array (or omitting
339
- * the field) matches all URLs — equivalent to `["**"]`.
367
+ * the field) matches all URLs — equivalent to `['**']`. The host(s) targeted here
368
+ * must also appear in the parent experiment settings' `whitelistDomains` — that
369
+ * allowlist is what limits which domains can load your experiments (see
370
+ * `GET /experiment-settings`). If the host is missing, the SDK refuses to load
371
+ * there and the experiment never runs, even after `POST /experiments/{id}/start`
372
+ * succeeds.
340
373
  */
341
374
  urlPatterns: Array<string>;
342
375
 
@@ -629,7 +662,12 @@ export namespace ExperimentCreateResponse {
629
662
  /**
630
663
  * Glob-style URL patterns that must match for the experiment to be eligible. Up to
631
664
  * 200 patterns; each pattern up to 2000 characters. An empty array (or omitting
632
- * the field) matches all URLs — equivalent to `["**"]`.
665
+ * the field) matches all URLs — equivalent to `['**']`. The host(s) targeted here
666
+ * must also appear in the parent experiment settings' `whitelistDomains` — that
667
+ * allowlist is what limits which domains can load your experiments (see
668
+ * `GET /experiment-settings`). If the host is missing, the SDK refuses to load
669
+ * there and the experiment never runs, even after `POST /experiments/{id}/start`
670
+ * succeeds.
633
671
  */
634
672
  urlPatterns: Array<string>;
635
673
 
@@ -922,7 +960,12 @@ export namespace ExperimentRetrieveResponse {
922
960
  /**
923
961
  * Glob-style URL patterns that must match for the experiment to be eligible. Up to
924
962
  * 200 patterns; each pattern up to 2000 characters. An empty array (or omitting
925
- * the field) matches all URLs — equivalent to `["**"]`.
963
+ * the field) matches all URLs — equivalent to `['**']`. The host(s) targeted here
964
+ * must also appear in the parent experiment settings' `whitelistDomains` — that
965
+ * allowlist is what limits which domains can load your experiments (see
966
+ * `GET /experiment-settings`). If the host is missing, the SDK refuses to load
967
+ * there and the experiment never runs, even after `POST /experiments/{id}/start`
968
+ * succeeds.
926
969
  */
927
970
  urlPatterns: Array<string>;
928
971
 
@@ -1100,7 +1143,12 @@ export namespace ExperimentUpdateResponse {
1100
1143
  /**
1101
1144
  * Glob-style URL patterns that must match for the experiment to be eligible. Up to
1102
1145
  * 200 patterns; each pattern up to 2000 characters. An empty array (or omitting
1103
- * the field) matches all URLs — equivalent to `["**"]`.
1146
+ * the field) matches all URLs — equivalent to `['**']`. The host(s) targeted here
1147
+ * must also appear in the parent experiment settings' `whitelistDomains` — that
1148
+ * allowlist is what limits which domains can load your experiments (see
1149
+ * `GET /experiment-settings`). If the host is missing, the SDK refuses to load
1150
+ * there and the experiment never runs, even after `POST /experiments/{id}/start`
1151
+ * succeeds.
1104
1152
  */
1105
1153
  urlPatterns: Array<string>;
1106
1154
 
@@ -1301,7 +1349,12 @@ export namespace ExperimentStartResponse {
1301
1349
  /**
1302
1350
  * Glob-style URL patterns that must match for the experiment to be eligible. Up to
1303
1351
  * 200 patterns; each pattern up to 2000 characters. An empty array (or omitting
1304
- * the field) matches all URLs — equivalent to `["**"]`.
1352
+ * the field) matches all URLs — equivalent to `['**']`. The host(s) targeted here
1353
+ * must also appear in the parent experiment settings' `whitelistDomains` — that
1354
+ * allowlist is what limits which domains can load your experiments (see
1355
+ * `GET /experiment-settings`). If the host is missing, the SDK refuses to load
1356
+ * there and the experiment never runs, even after `POST /experiments/{id}/start`
1357
+ * succeeds.
1305
1358
  */
1306
1359
  urlPatterns: Array<string>;
1307
1360
 
@@ -1498,7 +1551,12 @@ export namespace ExperimentStopResponse {
1498
1551
  /**
1499
1552
  * Glob-style URL patterns that must match for the experiment to be eligible. Up to
1500
1553
  * 200 patterns; each pattern up to 2000 characters. An empty array (or omitting
1501
- * the field) matches all URLs — equivalent to `["**"]`.
1554
+ * the field) matches all URLs — equivalent to `['**']`. The host(s) targeted here
1555
+ * must also appear in the parent experiment settings' `whitelistDomains` — that
1556
+ * allowlist is what limits which domains can load your experiments (see
1557
+ * `GET /experiment-settings`). If the host is missing, the SDK refuses to load
1558
+ * there and the experiment never runs, even after `POST /experiments/{id}/start`
1559
+ * succeeds.
1502
1560
  */
1503
1561
  urlPatterns: Array<string>;
1504
1562
 
@@ -1695,7 +1753,12 @@ export namespace ExperimentPauseResponse {
1695
1753
  /**
1696
1754
  * Glob-style URL patterns that must match for the experiment to be eligible. Up to
1697
1755
  * 200 patterns; each pattern up to 2000 characters. An empty array (or omitting
1698
- * the field) matches all URLs — equivalent to `["**"]`.
1756
+ * the field) matches all URLs — equivalent to `['**']`. The host(s) targeted here
1757
+ * must also appear in the parent experiment settings' `whitelistDomains` — that
1758
+ * allowlist is what limits which domains can load your experiments (see
1759
+ * `GET /experiment-settings`). If the host is missing, the SDK refuses to load
1760
+ * there and the experiment never runs, even after `POST /experiments/{id}/start`
1761
+ * succeeds.
1699
1762
  */
1700
1763
  urlPatterns: Array<string>;
1701
1764
 
@@ -1892,7 +1955,12 @@ export namespace ExperimentResumeResponse {
1892
1955
  /**
1893
1956
  * Glob-style URL patterns that must match for the experiment to be eligible. Up to
1894
1957
  * 200 patterns; each pattern up to 2000 characters. An empty array (or omitting
1895
- * the field) matches all URLs — equivalent to `["**"]`.
1958
+ * the field) matches all URLs — equivalent to `['**']`. The host(s) targeted here
1959
+ * must also appear in the parent experiment settings' `whitelistDomains` — that
1960
+ * allowlist is what limits which domains can load your experiments (see
1961
+ * `GET /experiment-settings`). If the host is missing, the SDK refuses to load
1962
+ * there and the experiment never runs, even after `POST /experiments/{id}/start`
1963
+ * succeeds.
1896
1964
  */
1897
1965
  urlPatterns: Array<string>;
1898
1966
 
@@ -2024,6 +2092,69 @@ export namespace ExperimentResultsTimeSeriesResponse {
2024
2092
  }
2025
2093
  }
2026
2094
 
2095
+ export interface ExperimentSessionReplaysResponse {
2096
+ /**
2097
+ * Sessions in which a `$experiment_impression` event for this experiment was
2098
+ * recorded, ordered newest first by session start time.
2099
+ */
2100
+ entities: Array<ExperimentSessionReplaysResponse.Entity>;
2101
+
2102
+ pagination: ExperimentSessionReplaysResponse.Pagination;
2103
+ }
2104
+
2105
+ export namespace ExperimentSessionReplaysResponse {
2106
+ export interface Entity {
2107
+ /**
2108
+ * Time between the first and last events recorded for this session, in whole
2109
+ * seconds.
2110
+ */
2111
+ durationSeconds: number;
2112
+
2113
+ /**
2114
+ * Number of distinct page paths visited during this session.
2115
+ */
2116
+ pageCount: number;
2117
+
2118
+ /**
2119
+ * Deep link to the in-app replay viewer for this session. Requires an
2120
+ * authenticated session in the Ours Privacy app for an account that owns this
2121
+ * experiment — not embeddable in customer-facing emails.
2122
+ */
2123
+ replayUrl: string;
2124
+
2125
+ /**
2126
+ * Session identifier (`dp_sid`). Combine with `visitorId` and the `YYYY-MM-DD`
2127
+ * date of `startTime` to deep-link to a replay outside of the response
2128
+ * `replayUrl`.
2129
+ */
2130
+ sessionId: string;
2131
+
2132
+ /**
2133
+ * ISO-8601 timestamp of the first event recorded in this session. Sessions are
2134
+ * ordered newest first by this field.
2135
+ */
2136
+ startTime: string;
2137
+
2138
+ /**
2139
+ * Human-readable name of the variant the visitor was assigned for the recorded
2140
+ * impression. May be empty if the variant has been deleted since the impression
2141
+ * fired.
2142
+ */
2143
+ variantName: string;
2144
+
2145
+ /**
2146
+ * Visitor identifier whose session is recorded here.
2147
+ */
2148
+ visitorId: string;
2149
+ }
2150
+
2151
+ export interface Pagination {
2152
+ hasMore: boolean;
2153
+
2154
+ nextCursor?: string | null;
2155
+ }
2156
+ }
2157
+
2027
2158
  export interface ExperimentListParams extends CursorParams {
2028
2159
  /**
2029
2160
  * Optional case-insensitive text search matched against experiment ID, name, and
@@ -2155,7 +2286,12 @@ export namespace ExperimentCreateParams {
2155
2286
  /**
2156
2287
  * Glob-style URL patterns that must match for the experiment to be eligible. Up to
2157
2288
  * 200 patterns; each pattern up to 2000 characters. An empty array (or omitting
2158
- * the field) matches all URLs — equivalent to `["**"]`.
2289
+ * the field) matches all URLs — equivalent to `['**']`. The host(s) targeted here
2290
+ * must also appear in the parent experiment settings' `whitelistDomains` — that
2291
+ * allowlist is what limits which domains can load your experiments (see
2292
+ * `GET /experiment-settings`). If the host is missing, the SDK refuses to load
2293
+ * there and the experiment never runs, even after `POST /experiments/{id}/start`
2294
+ * succeeds.
2159
2295
  */
2160
2296
  urlPatterns: Array<string>;
2161
2297
 
@@ -2302,7 +2438,12 @@ export namespace ExperimentUpdateParams {
2302
2438
  /**
2303
2439
  * Glob-style URL patterns that must match for the experiment to be eligible. Up to
2304
2440
  * 200 patterns; each pattern up to 2000 characters. An empty array (or omitting
2305
- * the field) matches all URLs — equivalent to `["**"]`.
2441
+ * the field) matches all URLs — equivalent to `['**']`. The host(s) targeted here
2442
+ * must also appear in the parent experiment settings' `whitelistDomains` — that
2443
+ * allowlist is what limits which domains can load your experiments (see
2444
+ * `GET /experiment-settings`). If the host is missing, the SDK refuses to load
2445
+ * there and the experiment never runs, even after `POST /experiments/{id}/start`
2446
+ * succeeds.
2306
2447
  */
2307
2448
  urlPatterns: Array<string>;
2308
2449
 
@@ -2353,10 +2494,13 @@ export namespace ExperimentUpdateParams {
2353
2494
 
2354
2495
  export interface ExperimentStartParams {
2355
2496
  /**
2356
- * When true (default on the REST surface), publish the current draft version
2357
- * immediately after starting the experiment. Any other unpublished changes in the
2358
- * same account version are included in that publish. Pass `false` explicitly to
2359
- * stage the change without publishing; the response will report `pending_publish`.
2497
+ * When true (the default), atomically publish the experiment and its variants as a
2498
+ * new version after starting — this is the canonical publish path for experiment
2499
+ * changes. Any other unpublished non-experiment changes (destinations, mappings,
2500
+ * settings, etc.) currently in draft are included in the same publish. Pass
2501
+ * `false` explicitly to stage the change without publishing; the response will
2502
+ * report `pending_publish` and a separate `POST /rest/v1/versions` call is then
2503
+ * required.
2360
2504
  */
2361
2505
  publishAfterStart?: boolean;
2362
2506
  }
@@ -2419,6 +2563,26 @@ export interface ExperimentResultsTimeSeriesParams {
2419
2563
  startDate?: string;
2420
2564
  }
2421
2565
 
2566
+ export interface ExperimentSessionReplaysParams {
2567
+ /**
2568
+ * Opaque pagination cursor from pagination.nextCursor in the previous response. Do
2569
+ * not decode or modify it. Malformed cursors return 400 Bad Request.
2570
+ */
2571
+ cursor?: string;
2572
+
2573
+ /**
2574
+ * Maximum number of items to return. Defaults to 25; values below 1 are clamped to
2575
+ * 1 and values above 100 are clamped to 100.
2576
+ */
2577
+ limit?: number | null;
2578
+
2579
+ /**
2580
+ * Optional filter to a single variant ID. Returns sessions for all variants when
2581
+ * omitted.
2582
+ */
2583
+ variant_id?: string;
2584
+ }
2585
+
2422
2586
  export declare namespace Experiments {
2423
2587
  export {
2424
2588
  type ExperimentListResponse as ExperimentListResponse,
@@ -2432,6 +2596,7 @@ export declare namespace Experiments {
2432
2596
  type ExperimentResumeResponse as ExperimentResumeResponse,
2433
2597
  type ExperimentResultsResponse as ExperimentResultsResponse,
2434
2598
  type ExperimentResultsTimeSeriesResponse as ExperimentResultsTimeSeriesResponse,
2599
+ type ExperimentSessionReplaysResponse as ExperimentSessionReplaysResponse,
2435
2600
  type ExperimentListResponsesCursor as ExperimentListResponsesCursor,
2436
2601
  type ExperimentListParams as ExperimentListParams,
2437
2602
  type ExperimentCreateParams as ExperimentCreateParams,
@@ -2442,5 +2607,6 @@ export declare namespace Experiments {
2442
2607
  type ExperimentResumeParams as ExperimentResumeParams,
2443
2608
  type ExperimentResultsParams as ExperimentResultsParams,
2444
2609
  type ExperimentResultsTimeSeriesParams as ExperimentResultsTimeSeriesParams,
2610
+ type ExperimentSessionReplaysParams as ExperimentSessionReplaysParams,
2445
2611
  };
2446
2612
  }
@@ -64,6 +64,7 @@ export {
64
64
  type ExperimentResumeResponse,
65
65
  type ExperimentResultsResponse,
66
66
  type ExperimentResultsTimeSeriesResponse,
67
+ type ExperimentSessionReplaysResponse,
67
68
  type ExperimentListParams,
68
69
  type ExperimentCreateParams,
69
70
  type ExperimentUpdateParams,
@@ -73,6 +74,7 @@ export {
73
74
  type ExperimentResumeParams,
74
75
  type ExperimentResultsParams,
75
76
  type ExperimentResultsTimeSeriesParams,
77
+ type ExperimentSessionReplaysParams,
76
78
  type ExperimentListResponsesCursor,
77
79
  } from './experiments';
78
80
  export {
@@ -112,10 +112,9 @@ export namespace SourceListResponse {
112
112
  selectedAccountId?: string | null;
113
113
 
114
114
  /**
115
- * Optional domain allowlist for source event ingestion. When set, only requests
116
- * from these domains are accepted for this source. This is separate from
117
- * experimentation settings `whitelistDomains`, which gates experiment SDK
118
- * delivery.
115
+ * Limits which domains can send events to the CDP. When set, only requests from
116
+ * these domains are accepted for this source. Separate from experiment settings
117
+ * `whitelistDomains`, which limits which domains can load your experiments.
119
118
  */
120
119
  whitelistDomains?: Array<string> | null;
121
120
 
@@ -223,10 +222,9 @@ export interface SourceRetrieveResponse {
223
222
  selectedAccountId?: string | null;
224
223
 
225
224
  /**
226
- * Optional domain allowlist for source event ingestion. When set, only requests
227
- * from these domains are accepted for this source. This is separate from
228
- * experimentation settings `whitelistDomains`, which gates experiment SDK
229
- * delivery.
225
+ * Limits which domains can send events to the CDP. When set, only requests from
226
+ * these domains are accepted for this source. Separate from experiment settings
227
+ * `whitelistDomains`, which limits which domains can load your experiments.
230
228
  */
231
229
  whitelistDomains?: Array<string> | null;
232
230
 
@@ -20,12 +20,22 @@ export class Versions extends APIResource {
20
20
  }
21
21
 
22
22
  /**
23
- * Publish the current draft (i.e. all unpublished entity changes) as a new
24
- * version. Returns the full Version on success. Returns HTTP 409 with the reason
25
- * in the response `error` field when there are no draft changes to publish, when
26
- * another publish is already in flight, or when the action otherwise conflicts
27
- * with current state. To re-publish an existing version, use POST
28
- * /rest/v1/versions/{id}/publish instead. Requires scope: version:publish
23
+ * Publish the current draft of non-experiment entities (destinations, mappings,
24
+ * experiment settings, governance rules, etc.) as a new version. Newly created or
25
+ * modified DRAFT experiments and experiment variants are NOT shipped here — call
26
+ * `POST /rest/v1/experiments/{id}/start` instead, which atomically publishes the
27
+ * experiment and its variants by default (`publishAfterStart: true`). Returns the
28
+ * full Version on success. Returns HTTP 409 with the reason in the response
29
+ * `error` field when there are no draft changes to publish, when another publish
30
+ * is already in flight, or when the action otherwise conflicts with current state.
31
+ * To re-publish an existing version, use POST /rest/v1/versions/{id}/publish
32
+ * instead.
33
+ *
34
+ * Supports cherry-picking via the `include*` body fields. Each `include*` field is
35
+ * an entity-id allowlist for one collection — omit (or send `[]`) to include every
36
+ * draft change in that collection, or send a non-empty array to whitelist only
37
+ * those ids. Unlisted collections inherit wholesale from the latest published
38
+ * version. Requires scope: version:publish
29
39
  */
30
40
  create(body: VersionCreateParams, options?: RequestOptions): APIPromise<VersionCreateResponse> {
31
41
  return this._client.post('/rest/v1/versions', { body, ...options });
@@ -72,8 +82,14 @@ export class Versions extends APIResource {
72
82
  * Compare two versions of the account configuration. Returns
73
83
  * added/removed/modified entities grouped by collection, plus a total `count`.
74
84
  *
75
- * - `GET /rest/v1/versions/draft/diff` — compare the current draft (all
76
- * unpublished entity changes) against the latest published version. Use this to
85
+ * Draft experiments and experiment variants do NOT appear in any diff — only
86
+ * experiments that are already running (or paused/completed) snapshot into
87
+ * versions. Use the experiment lifecycle endpoints (`/start`, `/stop`, etc.) to
88
+ * ship experiment changes; use these diff endpoints only for non-experiment
89
+ * entities (destinations, mappings, experiment settings, governance rules, etc.).
90
+ *
91
+ * - `GET /rest/v1/versions/draft/diff` — compare the current draft of
92
+ * non-experiment entities against the latest published version. Use this to
77
93
  * preview what would be included in a `POST /rest/v1/versions` call. (`draft` is
78
94
  * a literal path segment — there is no version with that ID; it identifies the
79
95
  * comparison target.)
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.15.1'; // x-release-please-version
1
+ export const VERSION = '1.16.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.15.1";
1
+ export declare const VERSION = "1.16.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.15.1";
1
+ export declare const VERSION = "1.16.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.15.1'; // x-release-please-version
4
+ exports.VERSION = '1.16.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.15.1'; // x-release-please-version
1
+ export const VERSION = '1.16.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map