You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/extension-commerce-bm-seo/README.md
+14-28Lines changed: 14 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,22 @@
1
-
# SEO Extension
1
+
# Commerce Business Manager SEO Extension
2
2
3
-
A [PWA Kit](https://github.com/SalesforceCommerceCloud/pwa-kit) extension that adds SEO functionality to your application through the [Shopper SEO URL Mapping API](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-seo?meta=getUrlMapping). This extension provides features like:
3
+
A [PWA Kit](https://github.com/SalesforceCommerceCloud/pwa-kit) extension that synchronizes Business Manager-managed routes with your PWA Kit application using the [Shopper SEO URL Mapping API](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-seo?meta=getUrlMapping). This extension provides the following capabilities:
4
4
5
5
- Integrate routes managed in Business Manager with the PWA Kit
6
-
- Integration with SCAPI Shopper SEO URL Mapping API
7
-
- Support for multiple resource types (products, categories)
6
+
- Integration with the SCAPI Shopper SEO URL Mapping API
7
+
- Support for multiple resource types including products, categories, and redirects
8
+
9
+
Note: Using this extension will impact performance as it requires API calls during navigation.
8
10
9
11
## Installation
10
12
11
13
```sh
12
14
npm install @salesforce/extension-commerce-bm-seo
13
-
14
-
# Also:
15
-
# - install the peer dependencies listed in the package.json
16
-
# - see the Peer Dependancies section below for any other steps (e.g. make sure your app uses CommerceApiProvider component)
17
15
```
18
16
19
-
## Peer Dependencies
20
-
21
-
PWA-Kit Application Extensions are NPM packages at their most simplest form, and as such you can define
22
-
what peer dependencies are required when using it. Because this application extension provides
23
-
Chakra UI via a page and components, it requires that the some peer dependencies are installed.
24
-
25
-
Depending on what features your application extensions provides it's recommended you include any third-party
26
-
packages as peer dependencies so that your base application doesn't end up having multiple versions of a
27
-
given package. See package.json for the full list of peer dependencies.
28
-
29
17
## Configuration
30
18
31
-
The SEO extension is configured via the `mobify.app.extensions`property in your config files or`package.json`:
19
+
The SEO extension is configured via your config file (e.g. `app/config/default.json`) or the key `mobify.app.extensions` in your `package.json`:
32
20
33
21
```json
34
22
{
@@ -53,7 +41,7 @@ The SEO extension is configured via the `mobify.app.extensions` property in your
53
41
},
54
42
"resourceTypeToComponentMap": {
55
43
"category": "ProductList",
56
-
"product": "ProductDetail",
44
+
"product": "ProductDetail"
57
45
}
58
46
}
59
47
]
@@ -75,17 +63,15 @@ The SEO extension is configured via the `mobify.app.extensions` property in your
75
63
-`commerceAPIAuth`: Authentication configuration
76
64
-`propertyNameInLocals`: Property name for storing auth in locals
77
65
-`resourceTypeToComponentMap`: Maps resource types to component names
78
-
-`category`: Component name for category pages
79
-
-`product`: Component name for product pages
80
-
-`content_asset`: Component name for content assets
66
+
-`category`: Name of component for category pages
67
+
-`product`: Name of component for product pages
68
+
-`content_asset`: Name of component for content assets
81
69
82
70
## How It Works
83
71
84
72
The SEO extension works by:
85
73
86
-
1.Intercepting incoming requests
74
+
1.Blocking navigation
87
75
2. Querying the Shopper SEO API for URL mappings
88
-
3. Dynamically routing to the appropriate component based on the resource type
89
-
4. Passing the relevant props to the component
90
-
91
-
The extension uses the Commerce API's Shopper SEO URL Mapping endpoint to handle SEO-friendly URLs and ensure proper routing within your PWA Kit application.
76
+
3. Routing to the appropriate component based on the resource type
0 commit comments