@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.
- package/dist/astro/index.cjs +3 -3
- package/dist/astro/index.d.cts +3 -0
- package/dist/astro/index.d.ts +3 -0
- package/dist/astro/index.js +3 -3
- package/dist/{chunk-72BQJDDK.js → chunk-H7VA7NGY.js} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/nextjs/components.cjs +1 -1
- package/dist/nextjs/components.d.cts +1 -1
- package/dist/nextjs/components.d.ts +1 -1
- package/dist/nextjs/components.js +1 -1
- package/dist/nextjs/index.cjs +3 -3
- package/dist/nextjs/index.d.cts +3 -0
- package/dist/nextjs/index.d.ts +3 -0
- package/dist/nextjs/index.js +3 -3
- package/dist/nuxt/index.cjs +3 -3
- package/dist/nuxt/index.d.cts +3 -0
- package/dist/nuxt/index.d.ts +3 -0
- package/dist/nuxt/index.js +3 -3
- package/dist/{pixel-Wsfvw9G2.d.cts → pixel-e1fUWl2Y.d.cts} +4 -1
- package/dist/{pixel-Wsfvw9G2.d.ts → pixel-e1fUWl2Y.d.ts} +4 -1
- package/dist/react/components.cjs +1 -1
- package/dist/react/components.js +1 -1
- package/dist/sveltekit/index.cjs +3 -3
- package/dist/sveltekit/index.d.cts +3 -0
- package/dist/sveltekit/index.d.ts +3 -0
- package/dist/sveltekit/index.js +3 -3
- package/package.json +1 -1
package/dist/astro/index.cjs
CHANGED
|
@@ -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.
|
|
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
|
-
"
|
|
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("
|
|
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}`);
|
package/dist/astro/index.d.cts
CHANGED
|
@@ -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
|
}
|
package/dist/astro/index.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/astro/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/version.ts
|
|
2
|
-
var VERSION = "0.4.
|
|
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
|
-
"
|
|
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("
|
|
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}`);
|
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.
|
|
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
|
-
"
|
|
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("
|
|
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-
|
|
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-
|
|
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.
|
|
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-
|
|
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-
|
|
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.
|
|
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-
|
|
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
|
-
"
|
|
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("
|
|
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.
|
|
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";
|
package/dist/nextjs/index.cjs
CHANGED
|
@@ -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.
|
|
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("
|
|
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
|
-
"
|
|
301
|
+
"User-Agent",
|
|
302
302
|
"Prepr-Package"
|
|
303
303
|
];
|
|
304
304
|
function getPreprHeadersFromHeaders(headers2) {
|
package/dist/nextjs/index.d.cts
CHANGED
|
@@ -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
|
}
|
package/dist/nextjs/index.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/nextjs/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { NextResponse } from "next/server";
|
|
3
3
|
|
|
4
4
|
// src/version.ts
|
|
5
|
-
var VERSION = "0.4.
|
|
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("
|
|
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
|
-
"
|
|
265
|
+
"User-Agent",
|
|
266
266
|
"Prepr-Package"
|
|
267
267
|
];
|
|
268
268
|
function getPreprHeadersFromHeaders(headers2) {
|
package/dist/nuxt/index.cjs
CHANGED
|
@@ -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.
|
|
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("
|
|
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
|
-
"
|
|
299
|
+
"User-Agent",
|
|
300
300
|
"Prepr-Package"
|
|
301
301
|
];
|
|
302
302
|
function getPreprHeadersFromHeaders(headers) {
|
package/dist/nuxt/index.d.cts
CHANGED
|
@@ -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
|
}
|
package/dist/nuxt/index.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/nuxt/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/version.ts
|
|
2
|
-
var VERSION = "0.4.
|
|
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("
|
|
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
|
-
"
|
|
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
|
}
|
package/dist/react/components.js
CHANGED
package/dist/sveltekit/index.cjs
CHANGED
|
@@ -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.
|
|
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("
|
|
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
|
-
"
|
|
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
|
}
|
package/dist/sveltekit/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/version.ts
|
|
2
|
-
var VERSION = "0.4.
|
|
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("
|
|
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
|
-
"
|
|
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.
|
|
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)",
|