@@ -25,7 +25,8 @@ export const { getSdk } = createSdk(
25
25
options ,
26
26
({ buildModule , config , middlewareModule , getRequestHeaders }) => ({
27
27
commerce: buildModule (middlewareModule < UnifiedEndpoints > , {
28
- apiUrl: config .middlewareUrl + " /commerce" ,
28
+ apiUrl: config .apiUrl + " /commerce" ,
29
+ ssrApiUrl: config .ssrApiUrl + " /commerce" ,
29
30
defaultRequestConfig: {
30
31
headers: getRequestHeaders (),
31
32
},
@@ -43,7 +44,8 @@ import { UnifiedEndpoints } from "storefront-middleware/types";
43
44
export default defineSdkConfig (
44
45
({ buildModule , config , middlewareModule , getRequestHeaders }) => ({
45
46
commerce: buildModule (middlewareModule < UnifiedEndpoints > , {
46
- apiUrl: config .middlewareUrl + " /commerce" , // SAP Commerce Cloud integration is available at /commerce endpoint
47
+ apiUrl: config .apiUrl + " /commerce" , // SAP Commerce Cloud integration is available at /commerce endpoint
48
+ ssrApiUrl: config .ssrApiUrl + " /commerce" , // SAP Commerce Cloud integration is available at /commerce endpoint
47
49
defaultRequestConfig: {
48
50
headers: getRequestHeaders (),
49
51
},
@@ -124,7 +126,7 @@ export const sdk = initSDK({
124
126
The ` middlewareModule ` accepts the following options:
125
127
126
128
- ` apiUrl ` - the URL of the middleware server,
127
- - ` ssrApiUrl ` - (Optional) the URL of the middleware server during SSR,
129
+ - ` ssrApiUrl ` - the URL of the middleware server during SSR,
128
130
- ` defaultRequestConfig ` - (Optional) default request config for each request,
129
131
- ` httpClient ` - (Optional) a custom HTTP client,
130
132
- ` errorHandler ` - (Optional) a custom error handler for HTTP requests.
@@ -376,7 +378,8 @@ import { UnifiedEndpoints } from "storefront-middleware/types";
376
378
export function getSdkConfig() {
377
379
return defineSdkConfig (({ buildModule , config , middlewareModule , getRequestHeaders }) => ({
378
380
commerce: buildModule (middlewareModule < UnifiedEndpoints > , {
379
- apiUrl: config .middlewareUrl + " /commerce" ,
381
+ apiUrl: config .apiUrl + " /commerce" ,
382
+ ssrApiUrl: config .ssrApiUrl + " /commerce" ,
380
383
defaultRequestConfig: {
381
384
headers: getRequestHeaders (),
382
385
},
@@ -393,7 +396,8 @@ import { UnifiedEndpoints } from "storefront-middleware/types";
393
396
export default defineSdkConfig (
394
397
({ buildModule , config , middlewareModule , getRequestHeaders }) => ({
395
398
commerce: buildModule (middlewareModule < UnifiedEndpoints > , {
396
- apiUrl: config .middlewareUrl + " /commerce" ,
399
+ apiUrl: config .apiUrl + " /commerce" ,
400
+ ssrApiUrl: config .ssrApiUrl + " /commerce" ,
397
401
defaultRequestConfig: {
398
402
headers: getRequestHeaders (),
399
403
},
0 commit comments