how to embed AEM React SPA app in other website

Avatar

Avatar

neerav_it

Avatar

neerav_it

neerav_it

09-02-2021

Hi team,

 

Our web lives within another team's website. we are recreating our site with AEM 6.5 React SPA and wanted to check about approch for itegration.

 

If it is react only app, we can include script tags along with matching div name and that should work but since it is AEM app seems like there is some problem on ModelManager side where it is taking a root path of current url instead of our app(just a guess). 

Any ideas or approch to embed our app in other team's site?

 

Thank you for your time and help

AEM 6.5 embed code Integrations React JS SPA

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

neerav_it

Avatar

neerav_it

neerav_it

22-02-2021

Able to resolve this issue via following method.

  • Added 3 js scripts and css links in external site ( clientlib-react.js,container.js,clientlib-base.js,clientlib-react.css)
  • in index,js where we initialize modelmanager, had to give our rootpath as an argument.(since our site was within external site, defualt rootpath was getting taken by browser url)(ModelManager.initialize(//your root page relative URL//))
  • in order to make sure that model.json doesn't load again, we manually check in json object to see if our page data is available(this step is not required)

Answers (1)

Answers (1)

Avatar

Avatar

Vijayalakshmi_S

MVP

Avatar

Vijayalakshmi_S

MVP

Vijayalakshmi_S
MVP

11-02-2021

Hi @neerav_it,

Could you please share the details/background of the website(Is it again hosted in AEM or any other external application) in which you are trying to incorporate the React app?