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