-
Notifications
You must be signed in to change notification settings - Fork 212
Expand file tree
/
Copy pathdefault.js.hbs
More file actions
209 lines (208 loc) · 10.4 KB
/
default.js.hbs
File metadata and controls
209 lines (208 loc) · 10.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/*
* Copyright (c) 2023, Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
/* eslint-disable @typescript-eslint/no-var-requires */
const sites = require('./sites.js')
const {parseSettings, validateOtpTokenLength} = require('./utils.js')
module.exports = {
app: {
// Enable the store locator and shop the store feature.
storeLocatorEnabled: true,
// Enable the multi-ship feature.
multishipEnabled: true,
// Enable partial hydration capabilities via Island component
{{#if answers.project.partialHydrationEnabled}}
partialHydrationEnabled: {{answers.project.partialHydrationEnabled}},
{{else}}
partialHydrationEnabled: false,
{{/if}}
// Commerce shopping agent configuration for embedded messaging service
// This enables an agentic shopping experience in the application
// This property accepts either a JSON string or a plain JavaScript object.
commerceAgent: parseSettings(process.env.COMMERCE_AGENT_SETTINGS) || {
enabled: 'false',
askAgentOnSearch: 'false',
embeddedServiceName: '',
embeddedServiceEndpoint: '',
scriptSourceUrl: '',
scrt2Url: '',
salesforceOrgId: '',
commerceOrgId: '',
siteId: '',
enableConversationContext: 'false',
conversationContext: [],
enableAgentFromHeader: 'false',
enableAgentFromFloatingButton: 'false',
enableAgentFromSearchSuggestions: 'false'
},
// Customize settings for your url
url: {
{{#if answers.project.demo.enableDemoSettings}}
// Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
site: 'path',
// Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
locale: 'path',
// This boolean value dictates whether default site or locale values are shown in the url. Defaults to: false
showDefaults: true,
{{else}}
// Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
site: 'none',
// Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
locale: 'none',
// This boolean value dictates whether or not default site or locale values are shown in the url. Defaults to: false
showDefaults: false,
{{/if}}
// This boolean value dictates whether the plus sign (+) is interpreted as space for query param string. Defaults to: false
interpretPlusSignAsSpace: false
},
login: {
// The length of the token for OTP authentication. Used by passwordless login and reset password.
// If the env var `OTP_TOKEN_LENGTH` is set, it will override the config value. Valid values are 6 or 8. Defaults to: 8
tokenLength: validateOtpTokenLength(process.env.OTP_TOKEN_LENGTH),
passwordless: {
// Enables or disables passwordless login for the site. Defaults to: false
{{#if answers.project.demo.enableDemoSettings}}
enabled: true,
{{else}}
enabled: false,
{{/if}}
// The mode for passwordless login. Valid values include 'email|callback'. Defaults to: 'callback'
mode: 'email',
// The callback URI, which can be an absolute URL (including third-party URIs) or a relative path set up by the developer.
// Required when mode is set to 'callback'. If the env var `PASSWORDLESS_LOGIN_CALLBACK_URI` is set, it will override the config value.
// callbackURI:
// process.env.PASSWORDLESS_LOGIN_CALLBACK_URI || '/passwordless-login-callback',
// The landing path for passwordless login
landingPath: '/passwordless-login-landing'
},
social: {
// Enables or disables social login for the site. Defaults to: false
{{#if answers.project.demo.enableDemoSettings}}
enabled: true,
{{else}}
enabled: false,
{{/if}}
// The third-party identity providers supported by your app. The PWA Kit supports Google and Apple by default.
// Additional IDPs will also need to be added to the IDP_CONFIG in the SocialLogin component.
idps: ['google', 'apple'],
// The redirect URI used after a successful social login authentication.
// This should be a relative path set up by the developer.
// If the env var `SOCIAL_LOGIN_REDIRECT_URI` is set, it will override the config value.
redirectURI: process.env.SOCIAL_LOGIN_REDIRECT_URI || '/social-callback'
},
resetPassword: {
// The mode for reset password. Valid values include 'email|callback'. Defaults to: 'callback'
mode: 'email',
// The callback URI, which can be an absolute URL (including third-party URIs) or a relative path set up by the developer.
// Required when mode is set to 'callback'. If the env var `RESET_PASSWORD_CALLBACK_URI` is set, it will override the config value.
// callbackURI: process.env.RESET_PASSWORD_CALLBACK_URI || '/reset-password-callback',
// The landing path for reset password
landingPath: '/reset-password-landing'
}
},
// The default site for your app. This value will be used when a siteRef could not be determined from the url
defaultSite: '{{answers.project.commerce.siteId}}',
// Provide aliases for your sites. These will be used in place of your site id when generating paths throughout the application.
{{#if answers.project.demo.enableDemoSettings}}
siteAliases: {
RefArch: 'us',
RefArchGlobal: 'global'
},
{{else}}
// siteAliases: {
// RefArch: 'us',
// RefArchGlobal: 'global'
// },
{{/if}}
// The sites for your app, which is imported from sites.js
sites,
// Commerce api config
commerceAPI: {
proxyPath: '/mobify/proxy/api',
parameters: {
clientId: '{{answers.project.commerce.clientId}}',
organizationId: '{{answers.project.commerce.organizationId}}',
shortCode: '{{answers.project.commerce.shortCode}}',
siteId: '{{answers.project.commerce.siteId}}'
}
},
// Einstein api config
einsteinAPI: {
host: 'https://api.cquotient.com',
einsteinId: '{{answers.project.einstein.clientId}}',
siteId: '{{answers.project.einstein.siteId}}',
// Flag Einstein activities as coming from a production environment.
// By setting this to true, the Einstein activities generated by the environment will appear
// in production environment reports
isProduction: false
},
// Datacloud api config
dataCloudAPI: {
appSourceId: '{{answers.project.dataCloud.appSourceId}}',
tenantId: '{{answers.project.dataCloud.tenantId}}'
},
// Note: this feature is in Developer Preview at this time. To use One Click Checkout,
// enable the oneClickCheckout flag and configure private SLAS client. For more details, please
// check https://github.com/SalesforceCommerceCloud/pwa-kit/releases/tag/v3.16.0
oneClickCheckout: {
enabled: false
},
// Bonus product config
pages: {
cart: {
groupBonusProductsWithQualifyingProduct: true
}
},
// Salesforce Payments configuration
// Set enabled to true to enable Salesforce Payments (requires the Salesforce Payments feature toggle to be enabled on the Commerce Cloud instance).
// Set enabled to false to disable Salesforce Payments on the storefront (the Commerce Cloud feature toggle is unaffected).
// sdkUrl and metadataUrl are hosted on your Commerce Cloud instance. Replace <hostname> with your instance hostname.
// This may be a demandware.net hostname (e.g., myinstance.unified.demandware.net) or a vanity/custom hostname.
// sdkUrl: 'https://<hostname>/on/demandware.static/Sites-Site/-/-/internal/jscript/sfp/v1/sfp.js'
// metadataUrl: 'https://<hostname>/on/demandware.static/Sites-Site/-/-/internal/metadata/v1.json'
sfPayments: {
enabled: false,
sdkUrl: '',
metadataUrl: ''
},
// Google Cloud api config
googleCloudAPI: {
apiKey: process.env.GOOGLE_CLOUD_API_KEY
}
},
// This list contains server-side only libraries that you don't want to be compiled by webpack
externals: [],
// Page not found url for your app
pageNotFoundURL: '/page-not-found',
// Enables or disables building the files necessary for server-side rendering.
ssrEnabled: true,
// This list determines which files are available exclusively to the server-side rendering system
// and are not available through the /mobify/bundle/ path.
ssrOnly: ['ssr.js', 'ssr.js.map', 'node_modules/**/*.*'],
// This list determines which files are available to the server-side rendering system
// and available through the /mobify/bundle/ path.
ssrShared: [
'static/ico/favicon.ico',
'static/robots.txt',
'**/*.js',
'**/*.js.map',
'**/*.json'
],
// Additional parameters that configure Express app behavior.
ssrParameters: {
ssrFunctionNodeVersion: '24.x',
proxyConfigs: [
{
host: '{{answers.project.commerce.shortCode}}.api.commercecloud.salesforce.com',
path: 'api'
}{{~#if answers.project.commerce.instanceUrl}},
{
host: '{{answers.project.commerce.instanceUrl}}',
path: 'ocapi'
}{{/if}}
]
}
}