A PWA Kit extension that synchronizes Business Manager-managed routes with your PWA Kit application using the Shopper SEO URL Mapping API. This extension provides the following capabilities:
- Integrate routes managed in Business Manager with the PWA Kit
- Integration with the SCAPI Shopper SEO URL Mapping API
- Support for multiple resource types including products, categories, and redirects
Note: Using this extension will impact performance as it requires API calls during navigation.
npm install @salesforce/extension-commerce-bm-seoThe SEO extension is configured via your config file (e.g. app/config/default.json) or the key mobify.app.extensions in your package.json:
{
"mobify": {
"app": {
"extensions": [
[
"@salesforce/extension-commerce-bm-seo",
{
"enabled": true,
"commerceAPI": {
"proxyPath": "/mobify/proxy/api",
"parameters": {
"shortCode": "8o7m175y",
"clientId": "c9c45bfd-0ed3-4aa2-9971-40f88962b836",
"organizationId": "f_ecom_zzrf_001",
"siteId": "RefArchGlobal"
}
},
"commerceAPIAuth": {
"propertyNameInLocals": "commerceAPIAuth"
},
"resourceTypeToComponentMap": {
"category": "ProductList",
"product": "ProductDetail"
}
}
]
]
}
}
}commerceAPI: Settings for connecting to the Commerce APIproxyPath: The proxy path for API requestsparameters: Commerce API connection parametersclientId: Your Commerce API client IDorganizationId: Your organization IDshortCode: Your short codesiteId: Your site ID
commerceAPIAuth: Authentication configurationpropertyNameInLocals: Property name for storing auth in locals
resourceTypeToComponentMap: Maps resource types to component namescategory: Name of component for category pagesproduct: Name of component for product pagescontent_asset: Name of component for content assets
The SEO extension works by:
- Blocking navigation
- Querying the Shopper SEO API for URL mappings
- Routing to the appropriate component based on the resource type
- Passing relevant props to the component