create-content-sdk-app 2.0.2-canary.4 → 2.0.2-canary.5
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,14 +1,22 @@
|
|
|
1
|
-
import { type NextRequest } from 'next/server';
|
|
1
|
+
import { NextFetchEvent, type NextRequest } from 'next/server';
|
|
2
2
|
import {
|
|
3
3
|
defineProxy,
|
|
4
4
|
MultisiteProxy,
|
|
5
5
|
PersonalizeProxy,
|
|
6
6
|
RedirectsProxy,
|
|
7
|
+
BotTrackingProxy,
|
|
7
8
|
} from '@sitecore-content-sdk/nextjs/proxy';
|
|
8
9
|
import sites from '.sitecore/sites.json';
|
|
9
10
|
import scConfig from 'sitecore.config';
|
|
10
11
|
|
|
11
|
-
export default function proxy(req: NextRequest) {
|
|
12
|
+
export default function proxy(req: NextRequest, event: NextFetchEvent) {
|
|
13
|
+
// BotTrackingProxy will detect and track bots before any other proxies run
|
|
14
|
+
const botTracking = new BotTrackingProxy({
|
|
15
|
+
...scConfig.api.edge,
|
|
16
|
+
sites,
|
|
17
|
+
fetchEvent: event,
|
|
18
|
+
});
|
|
19
|
+
|
|
12
20
|
// Instantiate proxies - they will use Edge config if available, otherwise fall back to local config
|
|
13
21
|
// Each proxy will skip processing if required API configuration is not available
|
|
14
22
|
const multisite = new MultisiteProxy({
|
|
@@ -62,7 +70,7 @@ export default function proxy(req: NextRequest) {
|
|
|
62
70
|
// },
|
|
63
71
|
});
|
|
64
72
|
|
|
65
|
-
return defineProxy(multisite, redirects, personalize).exec(req);
|
|
73
|
+
return defineProxy(botTracking, multisite, redirects, personalize).exec(req);
|
|
66
74
|
}
|
|
67
75
|
|
|
68
76
|
export const config = {
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import { type NextRequest } from 'next/server';
|
|
1
|
+
import { NextFetchEvent, type NextRequest } from 'next/server';
|
|
2
2
|
import {
|
|
3
3
|
defineProxy,
|
|
4
4
|
AppRouterMultisiteProxy,
|
|
5
5
|
PersonalizeProxy,
|
|
6
6
|
RedirectsProxy,
|
|
7
7
|
LocaleProxy,
|
|
8
|
+
BotTrackingProxy,
|
|
8
9
|
} from '@sitecore-content-sdk/nextjs/proxy';
|
|
9
10
|
import sites from '.sitecore/sites.json';
|
|
10
11
|
import scConfig from 'sitecore.config';
|
|
11
12
|
import { routing } from './i18n/routing';
|
|
12
13
|
|
|
13
|
-
export default function proxy(req: NextRequest) {
|
|
14
|
+
export default function proxy(req: NextRequest, event: NextFetchEvent) {
|
|
15
|
+
// BotTrackingProxy will detect and track bots before any other proxies run
|
|
16
|
+
const botTracking = new BotTrackingProxy({
|
|
17
|
+
...scConfig.api.edge,
|
|
18
|
+
sites,
|
|
19
|
+
fetchEvent: event,
|
|
20
|
+
});
|
|
21
|
+
|
|
14
22
|
// LocaleProxy and AppRouterMultisiteProxy must always run for App Router routing
|
|
15
23
|
const locale = new LocaleProxy({
|
|
16
24
|
/**
|
|
@@ -82,7 +90,7 @@ export default function proxy(req: NextRequest) {
|
|
|
82
90
|
// },
|
|
83
91
|
});
|
|
84
92
|
|
|
85
|
-
return defineProxy(locale, multisite, redirects, personalize).exec(req);
|
|
93
|
+
return defineProxy(botTracking, locale, multisite, redirects, personalize).exec(req);
|
|
86
94
|
}
|
|
87
95
|
|
|
88
96
|
export const config = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-content-sdk-app",
|
|
3
|
-
"version": "2.0.2-canary.
|
|
3
|
+
"version": "2.0.2-canary.5",
|
|
4
4
|
"description": "Sitecore Content SDK initializer",
|
|
5
5
|
"bin": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"ts-node": "^10.9.2",
|
|
71
71
|
"typescript": "~5.8.3"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "fdb8c65ed47243b18782342f18bca673484e8904"
|
|
74
74
|
}
|