Upload SPA to AEM Project

First, you must upload the external SPA to your AEM project.

  1. Replace src in the /ui.frontend project folder with your React application’s src folder.
  2. Include any additional dependencies in the app’s package.json in the /ui.frontend/package.json file.
  3. Include any customizations in the /public folder.
  4. Include any inline scripts or styles added in the /public/index.html file.

Configure the Remote SPA

Now that the external SPA is part of your AEM project, it must be configured within AEM.

Include Adobe SPA SDK Packages

To take advantage of AEM SPA features, there are dependencies on the following three packages.

The @adobe/aem-spa-page-model-manager package provides the API for initializing a Model Manager and retrieving the model from the AEM instance. This model can then be used to render AEM components using APIs from @adobe/aem-react-editable-components and @adobe/aem-spa-component-mapping.

Installation

Run the following npm command so you can install the required packages.

npm install --save @adobe/aem-spa-component-mapping @adobe/aem-spa-page-model-manager @adobe/aem-react-editable-components