Configuration Options for PWA Kit Projects

Important configuration options are set in two files within every PWA Kit project: the package.json file and app/commerce-api.config.js. Default values are set during initial project generation, but you can edit them at any time.

Project Configuration

The following table highlights the main project configuration options that can be edited within package.json:

Name Type Description
name String Identifier used to push code bundles. The value must match your project ID in the Runtime Admin tool.
mobify.ssrParameters.ssrFunctionNodeVersion String Determines which version of Node to use for running the App Server.

Allowed values: 14.x and 12.x.
mobify.ssrParameters.proxyConfigs Array of objects Configures request proxying.

See our guide to Proxying Requests for more information.

mobify.ssrEnabled Boolean Enables or disables building the files necessary for server-side rendering. Setting this value to false is deprecated as of August 2021.
mobify.ssrOnly Array of glob expressions where * is a wildcard matching zero or more of any character. Determines which files are available exclusively to the server-side rendering system and are not available through the /mobify/bundle/ path.

Defaults for a newly generated project:
mobify.ssrShared Array of glob expressions where * is a wildcard matching zero or more of any character. Determines which files are available to the server-side rendering system and available through the /mobify/bundle/ path.

Defaults for a newly generated project:
l10n.supportedLocales Array of strings Lists the locales available for localization.
l10n.defaultLocale String Determines the default locale.

API Access Configuration

The following code snippet highlights the API access options that can be edited in app/commerce-api.config.js:

For more information on the CommerceAPI class that consumes the configuration object in the previous code snippet, see our architecture guide to The Retail React App.

For more information on the setup tasks in Account Manager and Business Manager to enable API access for a B2C Commerce instance, see our guide to Setting Up API Access.