This document describes how to run PWA and ICM using the Hybrid Approach, so that pages from the Intershop Progressive Web App and pages from the classic storefront (Responsive Starter Store) can be run in parallel.
A possible scenario would be to have the shopping experience with all its SEO optimizations handled by the PWA and to delegate highly customized parts of the checkout or My Account area to the ICM.
The best way to deploy a Hybrid Approach installation with a shared domain is using the PWA Helm chart (0.4.0 and above with ICM 11) provided by Intershop.
For information on configuration of the PWA Helm chart for PWA and ICM, refer to the according Hybrid Approach paragraph.
The minimum version requirements for the involved systems are the following:
However, to deployed both together with a combined Helm chart ICM 11 is required.
This feature relies on the PWA and ICM being able to read and write each other's
This means that cookies written by the PWA and ICM must have the same domain and the same path. This works since all Responsive Starter Store requests and responses are proxied through the PWA SSR, simulating a common domain (an actual common domain for PWA and ICM is not required).
It is also important that the cookie must not be set to
apiToken cookie should be set with
The secure access required for the PWA/NGINX deployments in production-like environments is handled by the Ingress controller, so the PWA and the NGINX container itself can be deployed without SSL.
ICM only needs to be deployed with secure access anyway.
For a minimally invasive implementation, the mechanics for the Hybrid Approach are mainly implemented outside of ICM and in deployment-specific components of the PWA.
The ICM is proxied in the express.js server of the server-side rendering (SSR) process and hereby made available to the outside.
A newly introduced mapping table is used in the SSR to decide whether an incoming request should be handled by the PWA or the ICM.
This mapping table is also used in the browser-side PWA to switch from the single-page application context to the ICM.
The ICM must be run with Secure URL-only Server Configuration, which can be done by adding
SecureAccessOnly=true to the appserver configuration.
Furthermore, the synchronization of the
apiToken cookie must be switched on, so that users and baskets are synchronized between PWA and ICM.
See Concept - Integration of Progressive Web App and inSPIRED Storefront.
If you also want to support the correct handling for links generated in e-mails, the property
intershop.WebServerSecureURL must point to NGINX.
configuration via $SERVER/share/system/config/cluster/appserver.properties:
icm_as Helm chart:
The server-side rendering process must be started with
Only for development environments
The PWA must also be run with secure URLs if no NGINX is deployed to handle
https access to the PWA.
See SSR Startup - Development for a reference on how to achieve this locally.
Only for development environments
It might be necessary to set
TRUST_ICM=1 if the used development ICM is deployed with an insecure certificate.
Also, the Service Worker must be disabled for the PWA, as it installs itself in the browser of the client device and takes over the routing process, making it impossible to break out of the PWA and delegate to the ICM.
The Service Worker is disabled by default.
The mapping table resides in the PWA source code and provides the page-specific mapping configuration for the Hybrid Approach.
id: "Product Detail Page",
Each entry contains:
pwa) to decide on the target upstream
pwaBuild can use named capture groups.
They are only used in the node.js process running on the server.
icmBuild are used in the client application where named capture groups are not yet supported by all browsers.
With version 0.23.0 the PWA has been changed to no longer reuse the Responsive Starter Store application types, but rather to be based on the newly introduced headless application type for REST clients -
This application type is completely independent of the Responsive Starter Store.
For this reason, the PWA must be configured to know which application to use to work with the Responsive Starter Store again (
icmApplication setting to denote the
intershop.REST-based application used by the PWA (usually
rest in the inSPIRED demo scenario).
hybridApplication setting to denote the Responsive Starter Store application (usually
- in the inSPIRED demo scenario).
If for some reason the CMS content of the Responsive Starter Store is to be reused directly in the PWA in a Hybrid Approach, the PWA needs some code adaptions and has to use the same application as the Responsive Starter Store. For more details, see the older version of this documentation - Hybrid Approach - PWA Adaptions (3.0.0).
This section describes how to develop and test a PWA using the Hybrid Approach in a local development environment.
This development environment includes a local installation of ICM with the Responsive Starter Store, the PWA, and the NGINX.
In addition, it meets the requirements for a common domain and for
After successful configuration and deployment, you can access the different systems with these URLs:
|PWA (via NGINX)
https access and NGINX features
|direct access to the SSR rendering
|ICM (Responsive Starter Store)
|direct access, no Hybrid Approach
For a more realistic Hybrid Approach environment, it is not a good idea to use
localhost as the common domain or
127.0.0.1 as the IP address.
For this reason, a different common domain -
hybrid.local for this guide - must be configured in the operating system's
etc/hosts file, pointing to the real IP address of the computer.
The different parts of the server will then listen on different ports.
For this guide ICM will listen on port
7443 and the PWA SSR process will listen on port
7200 while the NGINX will respond on the default HTTPS port
The ICM needs to be set up like a regular ICM development environment.
Special configuration for the ports should be done in the
environment.properties (only the
webserverHttpsPort is really relevant for our
webserverPort = 7080
webserverHttpsPort = 7443
server/share/system/config/cluster/appserver.properties needs to contain:
apiToken cookie must be enabled
The configurations relevant to the Hybrid Approach for running the PWA are:
ICM_BASE_URL points to ICM https port -
SSR_HYBRID=true must be set
LOGGING=true helps with analysis and debugging
The PWA SSR process itself does not need to run with SSL/https.
This is taken care of by the NGINX container to provide the secure access to the PWA.
A local PWA built from the current PWA project sources can be run in a number of ways:
docker build -t dev_pwa . && docker run -it -p 7200:7200 -e ICM_BASE_URL=https://hybrid.local:7443 -e TRUST_ICM=true -e SSR_HYBRID=true -e LOGGING=true -e PORT=7200 --name hybrid-pwa dev_pwa
ICM_BASE_URL=https://hybrid.local:7443 TRUST_ICM=true SSR_HYBRID=true LOGGING=true PORT=7200 npm run start
Via bash with SSR development server with auto compile
ICM_BASE_URL=https://hybrid.local:7443 TRUST_ICM=true SSR_HYBRID=true LOGGING=true npm run start:ssr-dev -- --port 7200
A development Hybrid Approach setup can also be tested without NGINX.
In this case, the PWA SSR process must run with SSL.
This can be achieved by using
--ssl as an additional parameter.
The PWA with Hybrid Approach would then be reachable at
ICM_BASE_URL=https://hybrid.local:7443 TRUST_ICM=true SSR_HYBRID=true LOGGING=true npm run start:ssr-dev -- --port 7200 --ssl
The configurations relevant to the Hybrid Approach for running the NGINX are:
UPSTREAM_PWA points to the PWA SSR process -
SSL=true (available since PWA 3.1.0)
To start the NGINX container from the project sources with Docker:
docker build -t dev_nginx nginx && docker run -it -p 443:443 -e UPSTREAM_PWA=http://hybrid.local:7200 -e SSL=true -e CACHE=false --name hybrid-nginx dev_nginx
The NGINX of PWA releases prior to 3.1.0 does not support the
Previous versions needed the
UPSTREAM_PWA to be configured with
https and the files
server.crt had to be supplied in the container folder
/etx/nginx to start the NGINX with SSL.
docker build -t dev_nginx nginx && docker run -it -p 443:443 -e UPSTREAM_PWA=https://hybrid.local:7200 -e CACHE=false -v <full-path-to>/server.crt:/etc/nginx/server.crt -v <full-path-to>/server.key:/etc/nginx/server.key --name hybrid-nginx dev_nginx
Alternatively, the PWA and NGINX can also be started with