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: README.md
+20-7Lines changed: 20 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,19 +99,31 @@ Your site is now running at http://localhost:8000!
99
99
Edit `/pages/index.tsx` to see your site update in real-time!
100
100
101
101
# Product Module
102
-
> The Product Module is currently in beta. You can learn more about it [here](https://docs.medusajs.com/modules/products/serverless-module). In addition, the product module in the Next.js storefront can't be used without the Medusa backend at the moment.
102
+
> The Product Module is currently in beta. You can learn more about it [here](https://docs.medusajs.com/modules/products/serverless-module). In addition, the product module in the Next.js storefront can't be used without the Medusa backend running at the moment.
103
103
104
104
This starter has full support for our new serverless [Product Module](https://docs.medusajs.com/modules/products/serverless-module) for retrieving and manipulating product data directly from a serverless function. This keeps your product logic close to the frontend, making it easy to customize or extend Medusa's core functionality from within your Next.js project.
105
105
106
-
By default, this starter uses the standard Medusa API for product and collection retrieval. To enable the Product Module, follow these steps:
106
+
By default, this starter uses the standard Medusa API for product and collection retrieval. To enable the Product Module, first, make sure to set the following environment variables:
107
107
108
-
1. Make sure the `PRODUCT_POSTGRES_URL` and `NEXT_PUBLIC_BASE_URL` environment variables are set properly.
109
-
2. In `store.config.json`, set the `productModule` feature flag to `true` and save the file.
110
-
3. Restart the dev server.
108
+
-`PRODUCT_POSTGRES_URL`: the URL of your PostgreSQL databsae.
109
+
-`NEXT_PUBLIC_BASE_URL`: the URL of your storefront's base URL. If you're running it locally, it should be http://localhost:8000.
110
+
111
+
Then, enable the productModule feature flag in `./store.config.json`:
112
+
113
+
```javascript
114
+
{
115
+
"features": {
116
+
// other features...
117
+
"productModule":true
118
+
}
119
+
}
120
+
```
121
+
122
+
Make sure the Medusa backend is running, then start (or restart) your Next.js storefront.
111
123
112
124
Done! All product and collection data should now be coming from the module. The Product Module routes are all in `src/app/api` for you to edit and play around with.
113
125
114
-
To opt out of using the module, simply set the feature flag to `false` and restart the server.
126
+
To opt out of using the product module, simply set the`productModule` feature flag to `false` and restart the server.
115
127
116
128
# Payment integrations
117
129
@@ -133,9 +145,10 @@ You will also need to setup the integrations in your Medusa server. See the [Med
133
145
134
146
This starter is configured to support using the `medusa-search-meilisearch` plugin out of the box. To enable search you will need to enable the feature flag in `./store-config.json`, which you do by changing the config to this:
0 commit comments