@replohq/sdk 2.13.1 → 2.15.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ReploScriptType = "GA4" | "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "X" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "Mixpanel" | "HubSpot" | "Attentive" | "Cookiebot" | "snippet" | "custom" | "consentPlatform";
|
|
1
|
+
export type ReploScriptType = "GA4" | "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "X" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "Mixpanel" | "HubSpot" | "Attentive" | "Alia" | "Cookiebot" | "snippet" | "custom" | "consentPlatform";
|
|
2
2
|
export type ConsentCategory = "necessary" | "analytics" | "marketing" | "preferences" | "sale_of_data";
|
|
3
3
|
export type ConsentMode = "off" | "simple" | "per-category";
|
|
4
4
|
export type ScriptTagDescriptor = {
|
|
@@ -27,7 +27,7 @@ export type ScriptRuntimeOwner = {
|
|
|
27
27
|
};
|
|
28
28
|
export type MixpanelRegion = "us" | "eu" | "in";
|
|
29
29
|
export type ReploScriptEntry = {
|
|
30
|
-
type: "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "HubSpot" | "Attentive";
|
|
30
|
+
type: "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "HubSpot" | "Attentive" | "Alia";
|
|
31
31
|
identifier: string;
|
|
32
32
|
requiredConsent?: ConsentCategory[];
|
|
33
33
|
} | {
|
|
@@ -185,6 +185,20 @@ gtag('config', '${id}');`
|
|
|
185
185
|
attributes: { async: "true" }
|
|
186
186
|
}
|
|
187
187
|
]
|
|
188
|
+
},
|
|
189
|
+
Alia: {
|
|
190
|
+
defaultConsent: ["necessary"],
|
|
191
|
+
buildTags: (id) => [
|
|
192
|
+
{
|
|
193
|
+
kind: "inline",
|
|
194
|
+
body: `window.alia=window.alia||[];(function(){var sent=false;function sync(){var p=window.Replo&&window.Replo.customerPrivacy;if(sent||!p||!p.analyticsProcessingAllowed())return;sent=true;window.alia.push({type:"enableAnalyticsTracking"});}sync();document.addEventListener("visitorConsentCollected",sync);})();`
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
kind: "external",
|
|
198
|
+
src: `https://backend.alia-prod.com/public/launcher.js?shopifyUrl=${encodeURIComponent(id)}`,
|
|
199
|
+
attributes: { async: "true" }
|
|
200
|
+
}
|
|
201
|
+
]
|
|
188
202
|
}
|
|
189
203
|
};
|
|
190
204
|
function isXEventIdForPixel({
|
package/consent/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ReploScriptType = "GA4" | "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "X" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "HubSpot" | "Mixpanel" | "Attentive" | "Cookiebot" | "snippet" | "custom" | "consentPlatform";
|
|
1
|
+
export type ReploScriptType = "GA4" | "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "X" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "HubSpot" | "Mixpanel" | "Attentive" | "Alia" | "Cookiebot" | "snippet" | "custom" | "consentPlatform";
|
|
2
2
|
export type ConsentCategory = "necessary" | "analytics" | "marketing" | "preferences" | "sale_of_data";
|
|
3
3
|
export type ConsentMode = "off" | "simple" | "per-category";
|
|
4
4
|
declare module "react" {
|
|
@@ -36,7 +36,7 @@ export type ScriptRuntimeOwner = {
|
|
|
36
36
|
};
|
|
37
37
|
export type MixpanelRegion = "us" | "eu" | "in";
|
|
38
38
|
export type ReploScriptEntry = {
|
|
39
|
-
type: "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "HubSpot" | "Attentive";
|
|
39
|
+
type: "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "HubSpot" | "Attentive" | "Alia";
|
|
40
40
|
identifier: string;
|
|
41
41
|
requiredConsent?: ConsentCategory[];
|
|
42
42
|
} | {
|
package/lib/buildMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const BUILD_METADATA = {
|
|
2
2
|
"packageName": "@replohq/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.0",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-10-
|
|
5
|
+
"commit": "774d3fc49c9223dcec0ae2a83474c89c96ce5400",
|
|
6
|
+
"builtAt": "2026-10-31T01:00:17.935Z"
|
|
7
7
|
};
|
package/next/config.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createHash } from "crypto";
|
|
2
|
+
import { existsSync, readFileSync } from "fs";
|
|
3
|
+
import { createRequire } from "module";
|
|
2
4
|
import os from "os";
|
|
3
5
|
import path from "path";
|
|
4
6
|
const PLATFORM_DEV_ORIGINS = [
|
|
@@ -20,6 +22,33 @@ const PLATFORM_SERVER_ACTION_ORIGINS = [
|
|
|
20
22
|
];
|
|
21
23
|
const PLATFORM_DEVICE_SIZES = [640, 828, 1080, 1200, 1920, 2048, 3840];
|
|
22
24
|
const PLATFORM_IMAGE_SIZES = [32, 48, 96, 128, 256, 384];
|
|
25
|
+
const PLATFORM_RESOLVE_ALIAS = {
|
|
26
|
+
"../build/polyfills/polyfill-module": {
|
|
27
|
+
browser: "@replohq/sdk/next/polyfill-module"
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const VETTED_NEXT_POLYFILL_MODULE_SHA256 = "94c8008b70e41ac5b0360fd6f35ea7a59c20c6927aca7731ef8c6a3c26b9cddf";
|
|
31
|
+
function resolvePolyfillAlias() {
|
|
32
|
+
try {
|
|
33
|
+
const requireFromSite = createRequire(
|
|
34
|
+
path.join(process.cwd(), "package.json")
|
|
35
|
+
);
|
|
36
|
+
const source = readFileSync(
|
|
37
|
+
path.join(
|
|
38
|
+
path.dirname(requireFromSite.resolve("next/package.json")),
|
|
39
|
+
"dist/build/polyfills/polyfill-module.js"
|
|
40
|
+
)
|
|
41
|
+
);
|
|
42
|
+
if (createHash("sha256").update(source).digest("hex") === VETTED_NEXT_POLYFILL_MODULE_SHA256) {
|
|
43
|
+
return PLATFORM_RESOLVE_ALIAS;
|
|
44
|
+
}
|
|
45
|
+
} catch {
|
|
46
|
+
}
|
|
47
|
+
console.warn(
|
|
48
|
+
"[@replohq/sdk] Skipped the Next.js polyfill alias because next/dist/build/polyfills/polyfill-module.js is missing or differs from the vetted version, so Next's own polyfills ship. Re-vet the polyfill list and update VETTED_NEXT_POLYFILL_MODULE_SHA256 in @replohq/sdk/next/config."
|
|
49
|
+
);
|
|
50
|
+
return {};
|
|
51
|
+
}
|
|
23
52
|
const DEFAULT_PAGE_EXTENSIONS = ["tsx", "ts", "jsx", "js"];
|
|
24
53
|
const DEVELOPMENT_ONLY_PAGE_EXTENSIONS = ["dev.jsx", "dev.tsx"];
|
|
25
54
|
const BUILD_ONLY_PAGE_EXTENSIONS = ["published.tsx"];
|
|
@@ -61,7 +90,11 @@ function siteConfig(overrides = {}) {
|
|
|
61
90
|
outputFileTracingRoot: isBuild ? "/" : void 0,
|
|
62
91
|
turbopack: {
|
|
63
92
|
...overrideTurbopack,
|
|
64
|
-
root: isBuild ? "/" : devRoot
|
|
93
|
+
root: isBuild ? "/" : devRoot,
|
|
94
|
+
resolveAlias: {
|
|
95
|
+
...resolvePolyfillAlias(),
|
|
96
|
+
...overrideTurbopack?.resolveAlias
|
|
97
|
+
}
|
|
65
98
|
},
|
|
66
99
|
allowedDevOrigins: Array.from(
|
|
67
100
|
/* @__PURE__ */ new Set([...overrideDevOrigins ?? [], ...PLATFORM_DEV_ORIGINS])
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replohq/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.0",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sdk",
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.15.0",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-10-
|
|
8
|
+
"commit": "774d3fc49c9223dcec0ae2a83474c89c96ce5400",
|
|
9
|
+
"builtAt": "2026-10-31T01:00:17.935Z"
|
|
10
10
|
},
|
|
11
11
|
"description": "Replo SDK — cart, analytics, and data loaders for agent-built Next.js sites.",
|
|
12
12
|
"license": "SEE LICENSE IN LICENSE",
|
|
13
13
|
"type": "module",
|
|
14
|
-
"sideEffects":
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"./next/polyfill-module.js"
|
|
16
|
+
],
|
|
15
17
|
"exports": {
|
|
16
18
|
"./providers/replo-provider": {
|
|
17
19
|
"types": "./providers/replo-provider.d.ts",
|
|
@@ -297,6 +299,10 @@
|
|
|
297
299
|
"types": "./next/open-next.d.ts",
|
|
298
300
|
"default": "./next/open-next.js"
|
|
299
301
|
},
|
|
302
|
+
"./next/polyfill-module": {
|
|
303
|
+
"types": "./next/polyfill-module.d.ts",
|
|
304
|
+
"default": "./next/polyfill-module.js"
|
|
305
|
+
},
|
|
300
306
|
"./routing/evaluate": {
|
|
301
307
|
"types": "./routing/evaluate.d.ts",
|
|
302
308
|
"default": "./routing/evaluate.js"
|