@preprio/toolkit 0.4.2 → 0.4.3

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.
@@ -30,7 +30,7 @@ __export(astro_exports, {
30
30
  module.exports = __toCommonJS(astro_exports);
31
31
 
32
32
  // src/version.ts
33
- var VERSION = "0.4.2";
33
+ var VERSION = "0.4.3";
34
34
 
35
35
  // src/core/features.ts
36
36
  function isEnabled(config) {
@@ -83,7 +83,7 @@ var PREPR_HEADER_KEYS = [
83
83
  "Prepr-Visitor-IP",
84
84
  "Prepr-Hubspot-Id",
85
85
  "Prepr-Customer-Id-Created",
86
- "Prepr-User-Agent",
86
+ "User-Agent",
87
87
  "Prepr-Package"
88
88
  ];
89
89
  function getPreprHeadersFromHeaders(headers) {
@@ -272,7 +272,7 @@ function processFrameworkRequest(request, opts, framework) {
272
272
  }
273
273
  const userAgent = request.headers.get("user-agent");
274
274
  if (userAgent) {
275
- requestHeaders.set("Prepr-User-Agent", sanitizeHeaderValue(userAgent));
275
+ requestHeaders.set("User-Agent", sanitizeHeaderValue(userAgent));
276
276
  }
277
277
  const packageParts = [`@preprio/toolkit@${opts?.version ?? VERSION}`];
278
278
  if (framework) packageParts.push(`framework=${framework}`);
@@ -59,6 +59,9 @@ interface PreprHeaders {
59
59
  readonly 'Prepr-Visitor-IP'?: string;
60
60
  readonly 'Prepr-Hubspot-Id'?: string;
61
61
  readonly 'Prepr-Customer-Id-Created'?: 'true';
62
+ /** The visitor's browser User-Agent, used by the API for device detection. */
63
+ readonly 'User-Agent'?: string;
64
+ /** @deprecated Never populated; the visitor's value is under `User-Agent`. */
62
65
  readonly 'Prepr-User-Agent'?: string;
63
66
  readonly 'Prepr-Package'?: string;
64
67
  }
@@ -59,6 +59,9 @@ interface PreprHeaders {
59
59
  readonly 'Prepr-Visitor-IP'?: string;
60
60
  readonly 'Prepr-Hubspot-Id'?: string;
61
61
  readonly 'Prepr-Customer-Id-Created'?: 'true';
62
+ /** The visitor's browser User-Agent, used by the API for device detection. */
63
+ readonly 'User-Agent'?: string;
64
+ /** @deprecated Never populated; the visitor's value is under `User-Agent`. */
62
65
  readonly 'Prepr-User-Agent'?: string;
63
66
  readonly 'Prepr-Package'?: string;
64
67
  }
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "0.4.2";
2
+ var VERSION = "0.4.3";
3
3
 
4
4
  // src/core/features.ts
5
5
  function isEnabled(config) {
@@ -52,7 +52,7 @@ var PREPR_HEADER_KEYS = [
52
52
  "Prepr-Visitor-IP",
53
53
  "Prepr-Hubspot-Id",
54
54
  "Prepr-Customer-Id-Created",
55
- "Prepr-User-Agent",
55
+ "User-Agent",
56
56
  "Prepr-Package"
57
57
  ];
58
58
  function getPreprHeadersFromHeaders(headers) {
@@ -241,7 +241,7 @@ function processFrameworkRequest(request, opts, framework) {
241
241
  }
242
242
  const userAgent = request.headers.get("user-agent");
243
243
  if (userAgent) {
244
- requestHeaders.set("Prepr-User-Agent", sanitizeHeaderValue(userAgent));
244
+ requestHeaders.set("User-Agent", sanitizeHeaderValue(userAgent));
245
245
  }
246
246
  const packageParts = [`@preprio/toolkit@${opts?.version ?? VERSION}`];
247
247
  if (framework) packageParts.push(`framework=${framework}`);
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "0.4.2";
2
+ var VERSION = "0.4.3";
3
3
 
4
4
  // src/core/features.ts
5
5
  function isEnabled(config) {
package/dist/index.cjs CHANGED
@@ -44,7 +44,7 @@ __export(src_exports, {
44
44
  module.exports = __toCommonJS(src_exports);
45
45
 
46
46
  // src/version.ts
47
- var VERSION = "0.4.2";
47
+ var VERSION = "0.4.3";
48
48
 
49
49
  // src/core/features.ts
50
50
  function isEnabled(config) {
@@ -2323,7 +2323,7 @@ var PREPR_HEADER_KEYS = [
2323
2323
  "Prepr-Visitor-IP",
2324
2324
  "Prepr-Hubspot-Id",
2325
2325
  "Prepr-Customer-Id-Created",
2326
- "Prepr-User-Agent",
2326
+ "User-Agent",
2327
2327
  "Prepr-Package"
2328
2328
  ];
2329
2329
  function getPreprHeadersFromHeaders(headers) {
@@ -2520,7 +2520,7 @@ function processFrameworkRequest(request, opts, framework) {
2520
2520
  }
2521
2521
  const userAgent = request.headers.get("user-agent");
2522
2522
  if (userAgent) {
2523
- requestHeaders.set("Prepr-User-Agent", sanitizeHeaderValue(userAgent));
2523
+ requestHeaders.set("User-Agent", sanitizeHeaderValue(userAgent));
2524
2524
  }
2525
2525
  const packageParts = [`@preprio/toolkit@${opts?.version ?? VERSION}`];
2526
2526
  if (framework) packageParts.push(`framework=${framework}`);
package/dist/index.d.cts CHANGED
@@ -1,11 +1,11 @@
1
- import { P as PreprFeatures, R as ResolvedPreprFeatures, L as Locale, a as PreprSegment, b as PreprVariant, c as PreprToolbarProps, d as PreprPreviewOptions, e as PreprErrorCode, f as PreprHeaders } from './pixel-Wsfvw9G2.cjs';
2
- export { g as PreprEnvironment, h as PreprEventType, i as PreprFeatureConfig, j as PreprHeaderName, k as PreprPixelConfig, l as PreprToolbarComponentProps, m as PreprToolbarOptions, n as loadTrackingPixel, s as setTrackingParam, t as trackEvent } from './pixel-Wsfvw9G2.cjs';
1
+ import { P as PreprFeatures, R as ResolvedPreprFeatures, L as Locale, a as PreprSegment, b as PreprVariant, c as PreprToolbarProps, d as PreprPreviewOptions, e as PreprErrorCode, f as PreprHeaders } from './pixel-e1fUWl2Y.cjs';
2
+ export { g as PreprEnvironment, h as PreprEventType, i as PreprFeatureConfig, j as PreprHeaderName, k as PreprPixelConfig, l as PreprToolbarComponentProps, m as PreprToolbarOptions, n as loadTrackingPixel, s as setTrackingParam, t as trackEvent } from './pixel-e1fUWl2Y.cjs';
3
3
 
4
4
  /**
5
5
  * Package version; must match package.json. Lives in its own leaf module so
6
6
  * core can import it without cycling through the barrel.
7
7
  */
8
- declare const VERSION = "0.4.2";
8
+ declare const VERSION = "0.4.3";
9
9
 
10
10
  /**
11
11
  * Resolve a `PreprFeatures` bag to plain booleans, defaulting every omitted key
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { P as PreprFeatures, R as ResolvedPreprFeatures, L as Locale, a as PreprSegment, b as PreprVariant, c as PreprToolbarProps, d as PreprPreviewOptions, e as PreprErrorCode, f as PreprHeaders } from './pixel-Wsfvw9G2.js';
2
- export { g as PreprEnvironment, h as PreprEventType, i as PreprFeatureConfig, j as PreprHeaderName, k as PreprPixelConfig, l as PreprToolbarComponentProps, m as PreprToolbarOptions, n as loadTrackingPixel, s as setTrackingParam, t as trackEvent } from './pixel-Wsfvw9G2.js';
1
+ import { P as PreprFeatures, R as ResolvedPreprFeatures, L as Locale, a as PreprSegment, b as PreprVariant, c as PreprToolbarProps, d as PreprPreviewOptions, e as PreprErrorCode, f as PreprHeaders } from './pixel-e1fUWl2Y.js';
2
+ export { g as PreprEnvironment, h as PreprEventType, i as PreprFeatureConfig, j as PreprHeaderName, k as PreprPixelConfig, l as PreprToolbarComponentProps, m as PreprToolbarOptions, n as loadTrackingPixel, s as setTrackingParam, t as trackEvent } from './pixel-e1fUWl2Y.js';
3
3
 
4
4
  /**
5
5
  * Package version; must match package.json. Lives in its own leaf module so
6
6
  * core can import it without cycling through the barrel.
7
7
  */
8
- declare const VERSION = "0.4.2";
8
+ declare const VERSION = "0.4.3";
9
9
 
10
10
  /**
11
11
  * Resolve a `PreprFeatures` bag to plain booleans, defaulting every omitted key
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  setTrackingParam,
19
19
  stegaClean,
20
20
  trackEvent
21
- } from "./chunk-72BQJDDK.js";
21
+ } from "./chunk-H7VA7NGY.js";
22
22
 
23
23
  // src/core/server.ts
24
24
  var PreprError = class extends Error {
@@ -53,7 +53,7 @@ var PREPR_HEADER_KEYS = [
53
53
  "Prepr-Visitor-IP",
54
54
  "Prepr-Hubspot-Id",
55
55
  "Prepr-Customer-Id-Created",
56
- "Prepr-User-Agent",
56
+ "User-Agent",
57
57
  "Prepr-Package"
58
58
  ];
59
59
  function getPreprHeadersFromHeaders(headers) {
@@ -250,7 +250,7 @@ function processFrameworkRequest(request, opts, framework) {
250
250
  }
251
251
  const userAgent = request.headers.get("user-agent");
252
252
  if (userAgent) {
253
- requestHeaders.set("Prepr-User-Agent", sanitizeHeaderValue(userAgent));
253
+ requestHeaders.set("User-Agent", sanitizeHeaderValue(userAgent));
254
254
  }
255
255
  const packageParts = [`@preprio/toolkit@${opts?.version ?? VERSION}`];
256
256
  if (framework) packageParts.push(`framework=${framework}`);
@@ -2270,7 +2270,7 @@ function createPreprPreview(opts = {}) {
2270
2270
  var import_react = require("react");
2271
2271
 
2272
2272
  // src/version.ts
2273
- var VERSION = "0.4.2";
2273
+ var VERSION = "0.4.3";
2274
2274
 
2275
2275
  // src/core/pixel.ts
2276
2276
  var PIXEL_SCRIPT_URL = "https://cdn.tracking.prepr.io/js/prepr.min.js";
@@ -1,4 +1,4 @@
1
- import { k as PreprPixelConfig, l as PreprToolbarComponentProps } from '../pixel-Wsfvw9G2.cjs';
1
+ import { k as PreprPixelConfig, l as PreprToolbarComponentProps } from '../pixel-e1fUWl2Y.cjs';
2
2
 
3
3
  interface PreprTrackingPixelProps {
4
4
  /** Prepr tracking/access token. */
@@ -1,4 +1,4 @@
1
- import { k as PreprPixelConfig, l as PreprToolbarComponentProps } from '../pixel-Wsfvw9G2.js';
1
+ import { k as PreprPixelConfig, l as PreprToolbarComponentProps } from '../pixel-e1fUWl2Y.js';
2
2
 
3
3
  interface PreprTrackingPixelProps {
4
4
  /** Prepr tracking/access token. */
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  createPreprPreview,
4
4
  loadTrackingPixel
5
- } from "../chunk-72BQJDDK.js";
5
+ } from "../chunk-H7VA7NGY.js";
6
6
 
7
7
  // src/nextjs/components.ts
8
8
  import { usePathname, useRouter } from "next/navigation";
@@ -38,7 +38,7 @@ module.exports = __toCommonJS(nextjs_exports);
38
38
  var import_server = require("next/server");
39
39
 
40
40
  // src/version.ts
41
- var VERSION = "0.4.2";
41
+ var VERSION = "0.4.3";
42
42
 
43
43
  // src/core/constants.ts
44
44
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -133,7 +133,7 @@ function processFrameworkRequest(request, opts, framework) {
133
133
  }
134
134
  const userAgent = request.headers.get("user-agent");
135
135
  if (userAgent) {
136
- requestHeaders.set("Prepr-User-Agent", sanitizeHeaderValue(userAgent));
136
+ requestHeaders.set("User-Agent", sanitizeHeaderValue(userAgent));
137
137
  }
138
138
  const packageParts = [`@preprio/toolkit@${opts?.version ?? VERSION}`];
139
139
  if (framework) packageParts.push(`framework=${framework}`);
@@ -298,7 +298,7 @@ var PREPR_HEADER_KEYS = [
298
298
  "Prepr-Visitor-IP",
299
299
  "Prepr-Hubspot-Id",
300
300
  "Prepr-Customer-Id-Created",
301
- "Prepr-User-Agent",
301
+ "User-Agent",
302
302
  "Prepr-Package"
303
303
  ];
304
304
  function getPreprHeadersFromHeaders(headers2) {
@@ -119,6 +119,9 @@ interface PreprHeaders {
119
119
  readonly 'Prepr-Visitor-IP'?: string;
120
120
  readonly 'Prepr-Hubspot-Id'?: string;
121
121
  readonly 'Prepr-Customer-Id-Created'?: 'true';
122
+ /** The visitor's browser User-Agent, used by the API for device detection. */
123
+ readonly 'User-Agent'?: string;
124
+ /** @deprecated Never populated; the visitor's value is under `User-Agent`. */
122
125
  readonly 'Prepr-User-Agent'?: string;
123
126
  readonly 'Prepr-Package'?: string;
124
127
  }
@@ -119,6 +119,9 @@ interface PreprHeaders {
119
119
  readonly 'Prepr-Visitor-IP'?: string;
120
120
  readonly 'Prepr-Hubspot-Id'?: string;
121
121
  readonly 'Prepr-Customer-Id-Created'?: 'true';
122
+ /** The visitor's browser User-Agent, used by the API for device detection. */
123
+ readonly 'User-Agent'?: string;
124
+ /** @deprecated Never populated; the visitor's value is under `User-Agent`. */
122
125
  readonly 'Prepr-User-Agent'?: string;
123
126
  readonly 'Prepr-Package'?: string;
124
127
  }
@@ -2,7 +2,7 @@
2
2
  import { NextResponse } from "next/server";
3
3
 
4
4
  // src/version.ts
5
- var VERSION = "0.4.2";
5
+ var VERSION = "0.4.3";
6
6
 
7
7
  // src/core/constants.ts
8
8
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -97,7 +97,7 @@ function processFrameworkRequest(request, opts, framework) {
97
97
  }
98
98
  const userAgent = request.headers.get("user-agent");
99
99
  if (userAgent) {
100
- requestHeaders.set("Prepr-User-Agent", sanitizeHeaderValue(userAgent));
100
+ requestHeaders.set("User-Agent", sanitizeHeaderValue(userAgent));
101
101
  }
102
102
  const packageParts = [`@preprio/toolkit@${opts?.version ?? VERSION}`];
103
103
  if (framework) packageParts.push(`framework=${framework}`);
@@ -262,7 +262,7 @@ var PREPR_HEADER_KEYS = [
262
262
  "Prepr-Visitor-IP",
263
263
  "Prepr-Hubspot-Id",
264
264
  "Prepr-Customer-Id-Created",
265
- "Prepr-User-Agent",
265
+ "User-Agent",
266
266
  "Prepr-Package"
267
267
  ];
268
268
  function getPreprHeadersFromHeaders(headers2) {
@@ -35,7 +35,7 @@ __export(nuxt_exports, {
35
35
  module.exports = __toCommonJS(nuxt_exports);
36
36
 
37
37
  // src/version.ts
38
- var VERSION = "0.4.2";
38
+ var VERSION = "0.4.3";
39
39
 
40
40
  // src/core/constants.ts
41
41
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -144,7 +144,7 @@ function processFrameworkRequest(request, opts, framework) {
144
144
  }
145
145
  const userAgent = request.headers.get("user-agent");
146
146
  if (userAgent) {
147
- requestHeaders.set("Prepr-User-Agent", sanitizeHeaderValue(userAgent));
147
+ requestHeaders.set("User-Agent", sanitizeHeaderValue(userAgent));
148
148
  }
149
149
  const packageParts = [`@preprio/toolkit@${opts?.version ?? VERSION}`];
150
150
  if (framework) packageParts.push(`framework=${framework}`);
@@ -296,7 +296,7 @@ var PREPR_HEADER_KEYS = [
296
296
  "Prepr-Visitor-IP",
297
297
  "Prepr-Hubspot-Id",
298
298
  "Prepr-Customer-Id-Created",
299
- "Prepr-User-Agent",
299
+ "User-Agent",
300
300
  "Prepr-Package"
301
301
  ];
302
302
  function getPreprHeadersFromHeaders(headers) {
@@ -59,6 +59,9 @@ interface PreprHeaders {
59
59
  readonly 'Prepr-Visitor-IP'?: string;
60
60
  readonly 'Prepr-Hubspot-Id'?: string;
61
61
  readonly 'Prepr-Customer-Id-Created'?: 'true';
62
+ /** The visitor's browser User-Agent, used by the API for device detection. */
63
+ readonly 'User-Agent'?: string;
64
+ /** @deprecated Never populated; the visitor's value is under `User-Agent`. */
62
65
  readonly 'Prepr-User-Agent'?: string;
63
66
  readonly 'Prepr-Package'?: string;
64
67
  }
@@ -59,6 +59,9 @@ interface PreprHeaders {
59
59
  readonly 'Prepr-Visitor-IP'?: string;
60
60
  readonly 'Prepr-Hubspot-Id'?: string;
61
61
  readonly 'Prepr-Customer-Id-Created'?: 'true';
62
+ /** The visitor's browser User-Agent, used by the API for device detection. */
63
+ readonly 'User-Agent'?: string;
64
+ /** @deprecated Never populated; the visitor's value is under `User-Agent`. */
62
65
  readonly 'Prepr-User-Agent'?: string;
63
66
  readonly 'Prepr-Package'?: string;
64
67
  }
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "0.4.2";
2
+ var VERSION = "0.4.3";
3
3
 
4
4
  // src/core/constants.ts
5
5
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -108,7 +108,7 @@ function processFrameworkRequest(request, opts, framework) {
108
108
  }
109
109
  const userAgent = request.headers.get("user-agent");
110
110
  if (userAgent) {
111
- requestHeaders.set("Prepr-User-Agent", sanitizeHeaderValue(userAgent));
111
+ requestHeaders.set("User-Agent", sanitizeHeaderValue(userAgent));
112
112
  }
113
113
  const packageParts = [`@preprio/toolkit@${opts?.version ?? VERSION}`];
114
114
  if (framework) packageParts.push(`framework=${framework}`);
@@ -260,7 +260,7 @@ var PREPR_HEADER_KEYS = [
260
260
  "Prepr-Visitor-IP",
261
261
  "Prepr-Hubspot-Id",
262
262
  "Prepr-Customer-Id-Created",
263
- "Prepr-User-Agent",
263
+ "User-Agent",
264
264
  "Prepr-Package"
265
265
  ];
266
266
  function getPreprHeadersFromHeaders(headers) {
@@ -108,7 +108,7 @@ interface PreprToolbarProps {
108
108
  interface PreprToolbarComponentProps extends PreprToolbarProps {
109
109
  options?: PreprPreviewOptions;
110
110
  }
111
- type PreprHeaderName = 'prepr-customer-id' | 'Prepr-Segments' | 'Prepr-ABtesting' | 'Prepr-User-Agent';
111
+ type PreprHeaderName = 'prepr-customer-id' | 'Prepr-Segments' | 'Prepr-ABtesting' | 'User-Agent' | 'Prepr-User-Agent';
112
112
  type PreprVariant = 'A' | 'B';
113
113
  type PreprEnvironment = 'preview' | 'production';
114
114
  type PreprEventType = 'segment_changed' | 'variant_changed' | 'edit_mode_toggled' | 'preview_mode_toggled' | 'getScrollPosition' | 'loaded' | 'field_edit_requested';
@@ -126,6 +126,9 @@ interface PreprHeaders {
126
126
  readonly 'Prepr-Visitor-IP'?: string;
127
127
  readonly 'Prepr-Hubspot-Id'?: string;
128
128
  readonly 'Prepr-Customer-Id-Created'?: 'true';
129
+ /** The visitor's browser User-Agent, used by the API for device detection. */
130
+ readonly 'User-Agent'?: string;
131
+ /** @deprecated Never populated; the visitor's value is under `User-Agent`. */
129
132
  readonly 'Prepr-User-Agent'?: string;
130
133
  readonly 'Prepr-Package'?: string;
131
134
  }
@@ -108,7 +108,7 @@ interface PreprToolbarProps {
108
108
  interface PreprToolbarComponentProps extends PreprToolbarProps {
109
109
  options?: PreprPreviewOptions;
110
110
  }
111
- type PreprHeaderName = 'prepr-customer-id' | 'Prepr-Segments' | 'Prepr-ABtesting' | 'Prepr-User-Agent';
111
+ type PreprHeaderName = 'prepr-customer-id' | 'Prepr-Segments' | 'Prepr-ABtesting' | 'User-Agent' | 'Prepr-User-Agent';
112
112
  type PreprVariant = 'A' | 'B';
113
113
  type PreprEnvironment = 'preview' | 'production';
114
114
  type PreprEventType = 'segment_changed' | 'variant_changed' | 'edit_mode_toggled' | 'preview_mode_toggled' | 'getScrollPosition' | 'loaded' | 'field_edit_requested';
@@ -126,6 +126,9 @@ interface PreprHeaders {
126
126
  readonly 'Prepr-Visitor-IP'?: string;
127
127
  readonly 'Prepr-Hubspot-Id'?: string;
128
128
  readonly 'Prepr-Customer-Id-Created'?: 'true';
129
+ /** The visitor's browser User-Agent, used by the API for device detection. */
130
+ readonly 'User-Agent'?: string;
131
+ /** @deprecated Never populated; the visitor's value is under `User-Agent`. */
129
132
  readonly 'Prepr-User-Agent'?: string;
130
133
  readonly 'Prepr-Package'?: string;
131
134
  }
@@ -2266,7 +2266,7 @@ function createPreprPreview(opts = {}) {
2266
2266
  }
2267
2267
 
2268
2268
  // src/version.ts
2269
- var VERSION = "0.4.2";
2269
+ var VERSION = "0.4.3";
2270
2270
 
2271
2271
  // src/core/pixel.ts
2272
2272
  var PIXEL_SCRIPT_URL = "https://cdn.tracking.prepr.io/js/prepr.min.js";
@@ -2242,7 +2242,7 @@ function createPreprPreview(opts = {}) {
2242
2242
  }
2243
2243
 
2244
2244
  // src/version.ts
2245
- var VERSION = "0.4.2";
2245
+ var VERSION = "0.4.3";
2246
2246
 
2247
2247
  // src/core/pixel.ts
2248
2248
  var PIXEL_SCRIPT_URL = "https://cdn.tracking.prepr.io/js/prepr.min.js";
@@ -35,7 +35,7 @@ __export(sveltekit_exports, {
35
35
  module.exports = __toCommonJS(sveltekit_exports);
36
36
 
37
37
  // src/version.ts
38
- var VERSION = "0.4.2";
38
+ var VERSION = "0.4.3";
39
39
 
40
40
  // src/core/constants.ts
41
41
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -144,7 +144,7 @@ function processFrameworkRequest(request, opts, framework) {
144
144
  }
145
145
  const userAgent = request.headers.get("user-agent");
146
146
  if (userAgent) {
147
- requestHeaders.set("Prepr-User-Agent", sanitizeHeaderValue(userAgent));
147
+ requestHeaders.set("User-Agent", sanitizeHeaderValue(userAgent));
148
148
  }
149
149
  const packageParts = [`@preprio/toolkit@${opts?.version ?? VERSION}`];
150
150
  if (framework) packageParts.push(`framework=${framework}`);
@@ -292,7 +292,7 @@ var PREPR_HEADER_KEYS = [
292
292
  "Prepr-Visitor-IP",
293
293
  "Prepr-Hubspot-Id",
294
294
  "Prepr-Customer-Id-Created",
295
- "Prepr-User-Agent",
295
+ "User-Agent",
296
296
  "Prepr-Package"
297
297
  ];
298
298
  function getPreprHeadersFromHeaders(headers) {
@@ -59,6 +59,9 @@ interface PreprHeaders {
59
59
  readonly 'Prepr-Visitor-IP'?: string;
60
60
  readonly 'Prepr-Hubspot-Id'?: string;
61
61
  readonly 'Prepr-Customer-Id-Created'?: 'true';
62
+ /** The visitor's browser User-Agent, used by the API for device detection. */
63
+ readonly 'User-Agent'?: string;
64
+ /** @deprecated Never populated; the visitor's value is under `User-Agent`. */
62
65
  readonly 'Prepr-User-Agent'?: string;
63
66
  readonly 'Prepr-Package'?: string;
64
67
  }
@@ -59,6 +59,9 @@ interface PreprHeaders {
59
59
  readonly 'Prepr-Visitor-IP'?: string;
60
60
  readonly 'Prepr-Hubspot-Id'?: string;
61
61
  readonly 'Prepr-Customer-Id-Created'?: 'true';
62
+ /** The visitor's browser User-Agent, used by the API for device detection. */
63
+ readonly 'User-Agent'?: string;
64
+ /** @deprecated Never populated; the visitor's value is under `User-Agent`. */
62
65
  readonly 'Prepr-User-Agent'?: string;
63
66
  readonly 'Prepr-Package'?: string;
64
67
  }
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "0.4.2";
2
+ var VERSION = "0.4.3";
3
3
 
4
4
  // src/core/constants.ts
5
5
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -108,7 +108,7 @@ function processFrameworkRequest(request, opts, framework) {
108
108
  }
109
109
  const userAgent = request.headers.get("user-agent");
110
110
  if (userAgent) {
111
- requestHeaders.set("Prepr-User-Agent", sanitizeHeaderValue(userAgent));
111
+ requestHeaders.set("User-Agent", sanitizeHeaderValue(userAgent));
112
112
  }
113
113
  const packageParts = [`@preprio/toolkit@${opts?.version ?? VERSION}`];
114
114
  if (framework) packageParts.push(`framework=${framework}`);
@@ -256,7 +256,7 @@ var PREPR_HEADER_KEYS = [
256
256
  "Prepr-Visitor-IP",
257
257
  "Prepr-Hubspot-Id",
258
258
  "Prepr-Customer-Id-Created",
259
- "Prepr-User-Agent",
259
+ "User-Agent",
260
260
  "Prepr-Package"
261
261
  ];
262
262
  function getPreprHeadersFromHeaders(headers) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@preprio/toolkit",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Prepr personalization, A/B testing and preview toolkit for React, Next.js, Nuxt, Astro, SvelteKit and Express",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Prepr B.V. (https://prepr.io)",