Search code examples
sap-commerce-cloudspartacus-storefront

Hybris: What is the best way to manage data-smartedit-allow-origin (in index.html) for different environments if the application is hosted in CCV2?


What is the best way to manage data-smartedit-allow-origin (in index.html) for different environments if the application is hosted in CCV2? Currently, the value is hardcoded in index.html. For our Development Storefront, it's pointing to Development SmartEdit/Hybris. e.g. data-smartedit-allow-origin="Development-URL"

How about if we have other environments like Staging and Production environments? We are thinking of combining them into 1, like: data-smartedit-allow-origin="Development-URL,Staging-URL,Production-URL" But, this doesn't seem ideal. For Hybris, we can have different local.properties files for different environments. (e.g. local-dev.properties, local.prod.properties)


Solution

  • The current suggestion from the Spartacus Team is "to have a consistent list of wildcard values, that apply across dev/staging/prod". e.g. data-smartedit-allow-origin="*.company.com" . This means a Development storefront can allow SmartEdit of other environments.

    References: