@mercurjs/docs 2.2.1 → 2.3.0-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/content/home.mdx +107 -0
  2. package/content/learn/architecture.mdx +168 -83
  3. package/content/learn/introduction.mdx +161 -56
  4. package/content/learn/migration-to-2-0.mdx +187 -0
  5. package/content/learn/why-mercur.mdx +91 -0
  6. package/content/platform/attribute/concepts/attribute-types.mdx +59 -0
  7. package/content/platform/attribute/concepts/global-vs-inline.mdx +50 -0
  8. package/content/platform/attribute/concepts/variant-axes.mdx +61 -0
  9. package/content/platform/attribute/guides/attach-attributes-to-a-product.mdx +69 -0
  10. package/content/platform/attribute/guides/create-a-variant-axis.mdx +83 -0
  11. package/content/platform/attribute/guides/create-an-attribute.mdx +81 -0
  12. package/content/platform/attribute/overview.mdx +87 -0
  13. package/content/platform/attribute/reference/data-models.mdx +56 -0
  14. package/content/platform/attribute/reference/events.mdx +41 -0
  15. package/content/platform/attribute/reference/links.mdx +45 -0
  16. package/content/platform/attribute/reference/service.mdx +49 -0
  17. package/content/platform/attribute/reference/workflows.mdx +45 -0
  18. package/content/platform/catalog/concepts/master-products.mdx +54 -0
  19. package/content/platform/catalog/concepts/product-seller-allowlist.mdx +48 -0
  20. package/content/platform/catalog/concepts/status-lifecycle.mdx +58 -0
  21. package/content/platform/catalog/concepts/variants-categories-collections.mdx +49 -0
  22. package/content/platform/catalog/guides/allowlist-stores.mdx +59 -0
  23. package/content/platform/catalog/guides/create-a-master-product.mdx +70 -0
  24. package/content/platform/catalog/guides/publish-or-reject-a-product.mdx +79 -0
  25. package/content/platform/catalog/overview.mdx +90 -0
  26. package/content/platform/catalog/reference/data-models.mdx +66 -0
  27. package/content/platform/catalog/reference/events.mdx +41 -0
  28. package/content/platform/catalog/reference/links.mdx +44 -0
  29. package/content/platform/catalog/reference/service.mdx +52 -0
  30. package/content/platform/catalog/reference/workflows.mdx +40 -0
  31. package/content/platform/commission/concepts/order-commission-lines.mdx +65 -0
  32. package/content/platform/commission/concepts/rule-matching.mdx +86 -0
  33. package/content/platform/commission/concepts/rules-and-rates.mdx +84 -0
  34. package/content/platform/commission/guides/batch-update-rules.mdx +58 -0
  35. package/content/platform/commission/guides/create-a-rate.mdx +72 -0
  36. package/content/platform/commission/guides/refresh-order-commission-lines.mdx +55 -0
  37. package/content/platform/commission/overview.mdx +86 -0
  38. package/content/platform/commission/reference/data-models.mdx +75 -0
  39. package/content/platform/commission/reference/events.mdx +58 -0
  40. package/content/platform/commission/reference/links.mdx +45 -0
  41. package/content/platform/commission/reference/service.mdx +51 -0
  42. package/content/platform/commission/reference/workflows.mdx +40 -0
  43. package/content/platform/offer/concepts/pricing-and-inventory.mdx +72 -0
  44. package/content/platform/offer/concepts/shipping.mdx +48 -0
  45. package/content/platform/offer/concepts/what-is-an-offer.mdx +65 -0
  46. package/content/platform/offer/guides/bulk-create-offers.mdx +84 -0
  47. package/content/platform/offer/guides/create-an-offer.mdx +83 -0
  48. package/content/platform/offer/guides/manage-offer-inventory.mdx +53 -0
  49. package/content/platform/offer/overview.mdx +84 -0
  50. package/content/platform/offer/reference/data-models.mdx +56 -0
  51. package/content/platform/offer/reference/events.mdx +39 -0
  52. package/content/platform/offer/reference/links.mdx +60 -0
  53. package/content/platform/offer/reference/service.mdx +53 -0
  54. package/content/platform/offer/reference/workflows.mdx +38 -0
  55. package/content/platform/order-group/concepts/computed-totals.mdx +59 -0
  56. package/content/platform/order-group/concepts/order-splitting.mdx +61 -0
  57. package/content/platform/order-group/concepts/the-order-group.mdx +64 -0
  58. package/content/platform/order-group/guides/list-order-groups.mdx +67 -0
  59. package/content/platform/order-group/guides/retrieve-an-order-group.mdx +63 -0
  60. package/content/platform/order-group/guides/split-a-cart.mdx +58 -0
  61. package/content/platform/order-group/overview.mdx +83 -0
  62. package/content/platform/order-group/reference/data-models.mdx +40 -0
  63. package/content/platform/order-group/reference/events.mdx +37 -0
  64. package/content/platform/order-group/reference/links.mdx +45 -0
  65. package/content/platform/order-group/reference/service.mdx +50 -0
  66. package/content/platform/order-group/reference/workflows.mdx +39 -0
  67. package/content/platform/payout/concepts/account-lifecycle.mdx +75 -0
  68. package/content/platform/payout/concepts/accounts-and-onboarding.mdx +70 -0
  69. package/content/platform/payout/concepts/payout-pipeline.mdx +99 -0
  70. package/content/platform/payout/guides/create-a-payout-account.mdx +59 -0
  71. package/content/platform/payout/guides/process-a-provider-webhook.mdx +74 -0
  72. package/content/platform/payout/guides/start-provider-onboarding.mdx +50 -0
  73. package/content/platform/payout/overview.mdx +86 -0
  74. package/content/platform/payout/reference/data-models.mdx +61 -0
  75. package/content/platform/payout/reference/events.mdx +48 -0
  76. package/content/platform/payout/reference/links.mdx +36 -0
  77. package/content/platform/payout/reference/service.mdx +53 -0
  78. package/content/platform/payout/reference/workflows.mdx +32 -0
  79. package/content/platform/product-edit/concepts/change-actions.mdx +66 -0
  80. package/content/platform/product-edit/concepts/change-pipeline.mdx +69 -0
  81. package/content/platform/product-edit/concepts/status-and-auto-confirm.mdx +66 -0
  82. package/content/platform/product-edit/guides/confirm-or-decline-a-change.mdx +76 -0
  83. package/content/platform/product-edit/guides/edit-a-product.mdx +74 -0
  84. package/content/platform/product-edit/guides/request-a-revision.mdx +54 -0
  85. package/content/platform/product-edit/overview.mdx +85 -0
  86. package/content/platform/product-edit/reference/data-models.mdx +65 -0
  87. package/content/platform/product-edit/reference/events.mdx +47 -0
  88. package/content/platform/product-edit/reference/links.mdx +39 -0
  89. package/content/platform/product-edit/reference/service.mdx +43 -0
  90. package/content/platform/product-edit/reference/workflows.mdx +49 -0
  91. package/content/platform/review/concepts/product-vs-seller-reviews.mdx +63 -0
  92. package/content/platform/review/concepts/ratings-and-moderation.mdx +64 -0
  93. package/content/platform/review/concepts/the-review-model.mdx +56 -0
  94. package/content/platform/review/guides/compute-aggregate-ratings.mdx +57 -0
  95. package/content/platform/review/guides/create-a-review.mdx +55 -0
  96. package/content/platform/review/guides/moderate-a-review.mdx +58 -0
  97. package/content/platform/review/guides/respond-to-a-review.mdx +61 -0
  98. package/content/platform/review/overview.mdx +87 -0
  99. package/content/platform/review/reference/data-models.mdx +36 -0
  100. package/content/platform/review/reference/events.mdx +61 -0
  101. package/content/platform/review/reference/links.mdx +43 -0
  102. package/content/platform/review/reference/service.mdx +54 -0
  103. package/content/platform/review/reference/workflows.mdx +31 -0
  104. package/content/platform/store/concepts/lifecycle.mdx +62 -0
  105. package/content/platform/store/concepts/store-entity.mdx +53 -0
  106. package/content/platform/store/concepts/team.mdx +50 -0
  107. package/content/platform/store/guides/create-a-store.mdx +55 -0
  108. package/content/platform/store/guides/manage-the-team.mdx +55 -0
  109. package/content/platform/store/guides/moderate-a-store.mdx +59 -0
  110. package/content/platform/store/overview.mdx +86 -0
  111. package/content/platform/store/reference/data-models.mdx +89 -0
  112. package/content/platform/store/reference/events.mdx +43 -0
  113. package/content/platform/store/reference/links.mdx +71 -0
  114. package/content/platform/store/reference/service.mdx +51 -0
  115. package/content/platform/store/reference/workflows.mdx +35 -0
  116. package/content/references/api/admin/commission-rates/create-commission-rate.mdx +1 -1
  117. package/content/references/api/admin/commission-rates/list-commission-rates.mdx +2 -2
  118. package/content/references/api/admin/commission-rates/update-commission-rate.mdx +1 -1
  119. package/content/references/api/admin/offers/batch-create-offers.mdx +3 -3
  120. package/content/references/api/admin/order-groups/list-order-groups.mdx +1 -1
  121. package/content/references/api/admin/product-attributes/create-attribute-value.mdx +2 -2
  122. package/content/references/api/admin/product-attributes/create-product-attribute.mdx +1 -1
  123. package/content/references/api/admin/product-attributes/update-product-attribute.mdx +1 -1
  124. package/content/references/api/admin/product-changes/confirm-product-change.mdx +1 -1
  125. package/content/references/api/admin/products/batch-product-attributes.mdx +1 -1
  126. package/content/references/api/admin/products/create-product.mdx +1 -1
  127. package/content/references/api/admin/products/preview-product.mdx +1 -1
  128. package/content/references/api/admin.mdx +4 -5
  129. package/content/references/api/conventions.mdx +9 -7
  130. package/content/references/api/store/carts/add-line-item.mdx +1 -1
  131. package/content/references/api/store/offers/list-offers.mdx +1 -1
  132. package/content/references/api/store/order-groups/list-order-groups.mdx +1 -1
  133. package/content/references/api/store.mdx +4 -13
  134. package/content/references/api/vendor/members/accept-member-invite.mdx +1 -1
  135. package/content/references/api/vendor/offers/batch-create-offers.mdx +4 -0
  136. package/content/references/api/vendor/offers/batch-offer-inventory-items.mdx +2 -0
  137. package/content/references/api/vendor/offers/create-offer.mdx +13 -1
  138. package/content/references/api/vendor/offers/list-offers.mdx +4 -0
  139. package/content/references/api/vendor/offers/retrieve-offer.mdx +4 -0
  140. package/content/references/api/vendor/offers/update-offer.mdx +12 -0
  141. package/content/references/api/vendor/payout-accounts/create-onboarding.mdx +1 -1
  142. package/content/references/api/vendor/products/batch-product-attributes.mdx +1 -1
  143. package/content/references/api/vendor/products/create-product-variant.mdx +1 -1
  144. package/content/references/api/vendor/products/create-product.mdx +1 -1
  145. package/content/references/api/vendor/products/delete-product.mdx +1 -1
  146. package/content/references/api/vendor/products/update-product.mdx +1 -1
  147. package/content/references/api/vendor/sellers/create-seller.mdx +2 -2
  148. package/content/references/api/vendor/sellers/list-sellers.mdx +1 -1
  149. package/content/references/api/vendor.mdx +6 -5
  150. package/content/references/configuration.mdx +16 -33
  151. package/content/references/overview.mdx +34 -52
  152. package/content/references/panel-extensions/create-page.mdx +194 -0
  153. package/content/references/panel-extensions/custom-fields.mdx +256 -0
  154. package/content/references/panel-extensions/overview.mdx +102 -0
  155. package/content/references/panel-extensions/widgets.mdx +212 -0
  156. package/content/resources/ai/mcp.mdx +2 -2
  157. package/content/resources/ai/overview.mdx +21 -16
  158. package/content/resources/ai/skills.mdx +67 -0
  159. package/content/resources/best-practices/api-routes.mdx +55 -43
  160. package/content/resources/best-practices/custom-fields.mdx +116 -92
  161. package/content/resources/best-practices/frontend.mdx +62 -50
  162. package/content/resources/best-practices/module-links.mdx +48 -34
  163. package/content/resources/best-practices/modules.mdx +53 -27
  164. package/content/resources/best-practices/overview.mdx +45 -17
  165. package/content/resources/best-practices/subscribers-and-jobs.mdx +37 -24
  166. package/content/resources/best-practices/types.mdx +38 -23
  167. package/content/resources/best-practices/workflows.mdx +33 -21
  168. package/content/resources/customization/custom-fields.mdx +15 -15
  169. package/content/resources/customization/extend-a-workflow.mdx +7 -4
  170. package/content/resources/customization/extending-panels.mdx +55 -52
  171. package/content/resources/deployment/medusa-cloud.mdx +21 -20
  172. package/content/resources/deployment/self-host.mdx +123 -0
  173. package/content/resources/integrations/overview.mdx +38 -0
  174. package/content/resources/integrations/stripe-connect.mdx +39 -38
  175. package/content/resources/tutorials/add-a-block.mdx +25 -18
  176. package/content/resources/tutorials/add-a-widget.mdx +32 -23
  177. package/content/resources/tutorials/add-order-detail-button.mdx +33 -20
  178. package/content/resources/tutorials/attributes-and-variant-axes.mdx +28 -27
  179. package/content/resources/tutorials/build-a-block.mdx +26 -15
  180. package/content/resources/tutorials/custom-api-route.mdx +32 -20
  181. package/content/resources/tutorials/custom-panel-page.mdx +21 -12
  182. package/content/resources/tutorials/customize-navigation.mdx +30 -23
  183. package/content/resources/tutorials/extend-forms-and-tables.mdx +36 -28
  184. package/content/resources/tutorials/extend-onboarding.mdx +38 -35
  185. package/content/resources/tutorials/master-products-and-offers.mdx +28 -23
  186. package/content/telemetry.mdx +3 -3
  187. package/content/user-guide/admin/attributes/how-tos/create-an-attribute.mdx +64 -0
  188. package/content/user-guide/admin/attributes/how-tos/manage-possible-values.mdx +40 -0
  189. package/content/user-guide/admin/attributes/overview.mdx +22 -0
  190. package/content/user-guide/admin/commissions/how-tos/create-a-commission-rule.mdx +63 -0
  191. package/content/user-guide/admin/commissions/how-tos/edit-the-global-commission.mdx +48 -0
  192. package/content/user-guide/admin/commissions/how-tos/manage-a-commission-rule.mdx +45 -0
  193. package/content/user-guide/admin/commissions/overview.mdx +25 -0
  194. package/content/user-guide/admin/overview.mdx +20 -12
  195. package/content/user-guide/admin/product-requests/how-tos/review-a-new-product.mdx +58 -0
  196. package/content/user-guide/admin/product-requests/how-tos/review-a-product-edit.mdx +48 -0
  197. package/content/user-guide/admin/product-requests/overview.mdx +25 -0
  198. package/content/user-guide/vendor/offers/how-tos/create-an-offer.mdx +59 -0
  199. package/content/user-guide/vendor/offers/how-tos/update-prices-and-stock.mdx +40 -0
  200. package/content/user-guide/vendor/offers/overview.mdx +22 -0
  201. package/content/user-guide/vendor/onboarding.mdx +79 -0
  202. package/content/user-guide/vendor/orders/how-tos/fulfill-an-order.mdx +49 -0
  203. package/content/user-guide/vendor/orders/how-tos/mark-an-order-as-delivered.mdx +33 -0
  204. package/content/user-guide/vendor/orders/how-tos/process-a-return.mdx +42 -0
  205. package/content/user-guide/vendor/orders/how-tos/refund-an-order.mdx +38 -0
  206. package/content/user-guide/vendor/orders/how-tos/ship-an-order.mdx +40 -0
  207. package/content/user-guide/vendor/orders/overview.mdx +31 -0
  208. package/content/user-guide/vendor/overview.mdx +23 -12
  209. package/content/user-guide/vendor/products/how-tos/edit-a-product.mdx +44 -0
  210. package/content/user-guide/vendor/products/how-tos/submit-a-product.mdx +63 -0
  211. package/content/user-guide/vendor/products/overview.mdx +22 -0
  212. package/llms.txt +176 -142
  213. package/package.json +1 -1
  214. package/content/learn/concepts.mdx +0 -84
  215. package/content/learn/installation.mdx +0 -117
  216. package/content/learn/mirakl-alternative.mdx +0 -86
  217. package/content/migration/from-1-x-to-2-0.mdx +0 -152
  218. package/content/migration/from-2-0-to-2-1.mdx +0 -105
  219. package/content/migration/overview.mdx +0 -58
  220. package/content/references/api/store/search/search.mdx +0 -136
  221. package/content/references/modules/commission.mdx +0 -106
  222. package/content/references/modules/custom-fields.mdx +0 -45
  223. package/content/references/modules/media.mdx +0 -55
  224. package/content/references/modules/offer.mdx +0 -64
  225. package/content/references/modules/payout.mdx +0 -121
  226. package/content/references/modules/product-attribute.mdx +0 -111
  227. package/content/references/modules/product-edit.mdx +0 -80
  228. package/content/references/modules/search.mdx +0 -112
  229. package/content/references/modules/seller.mdx +0 -175
  230. package/content/references/panel-extension-api.mdx +0 -337
  231. package/content/references/workflows/cart/add-seller-shipping-method-to-cart.mdx +0 -48
  232. package/content/references/workflows/cart/complete-cart-with-split-orders.mdx +0 -36
  233. package/content/references/workflows/cart/list-seller-shipping-options-for-cart.mdx +0 -39
  234. package/content/references/workflows/cart/update-cart-seller-promotions.mdx +0 -42
  235. package/content/references/workflows/commission/batch-commission-rules.mdx +0 -49
  236. package/content/references/workflows/commission/create-commission-rates.mdx +0 -41
  237. package/content/references/workflows/commission/delete-commission-rates.mdx +0 -34
  238. package/content/references/workflows/commission/refresh-order-commission-lines.mdx +0 -30
  239. package/content/references/workflows/commission/update-commission-rates.mdx +0 -35
  240. package/content/references/workflows/media/set-category-images.mdx +0 -41
  241. package/content/references/workflows/media/set-collection-images.mdx +0 -41
  242. package/content/references/workflows/member/accept-member-invite.mdx +0 -33
  243. package/content/references/workflows/member/add-seller-member.mdx +0 -30
  244. package/content/references/workflows/member/create-member-invites.mdx +0 -34
  245. package/content/references/workflows/member/delete-member-invite.mdx +0 -24
  246. package/content/references/workflows/member/remove-seller-member.mdx +0 -28
  247. package/content/references/workflows/member/resend-member-invite.mdx +0 -28
  248. package/content/references/workflows/member/update-member-role.mdx +0 -28
  249. package/content/references/workflows/member/update-member.mdx +0 -35
  250. package/content/references/workflows/offer/batch-offer-inventory-items.mdx +0 -62
  251. package/content/references/workflows/offer/create-offers.mdx +0 -65
  252. package/content/references/workflows/offer/delete-offers.mdx +0 -35
  253. package/content/references/workflows/offer/update-offers.mdx +0 -53
  254. package/content/references/workflows/order/cancel-order-fulfillment.mdx +0 -34
  255. package/content/references/workflows/order/confirm-claim-request.mdx +0 -25
  256. package/content/references/workflows/order/confirm-exchange-request.mdx +0 -25
  257. package/content/references/workflows/order/confirm-order-edit-request.mdx +0 -25
  258. package/content/references/workflows/order/confirm-return-receive.mdx +0 -25
  259. package/content/references/workflows/order/create-order-fulfillment.mdx +0 -45
  260. package/content/references/workflows/order-group/get-order-group-detail.mdx +0 -29
  261. package/content/references/workflows/order-group/get-order-groups-list.mdx +0 -38
  262. package/content/references/workflows/overview.mdx +0 -72
  263. package/content/references/workflows/payout/create-onboarding.mdx +0 -36
  264. package/content/references/workflows/payout/create-payout-account.mdx +0 -33
  265. package/content/references/workflows/payout/create-payout.mdx +0 -30
  266. package/content/references/workflows/payout/process-payout-for-webhook.mdx +0 -34
  267. package/content/references/workflows/product/confirm-products.mdx +0 -48
  268. package/content/references/workflows/product/create-products.mdx +0 -63
  269. package/content/references/workflows/product/link-sellers-to-product-category.mdx +0 -40
  270. package/content/references/workflows/product/link-sellers-to-product.mdx +0 -40
  271. package/content/references/workflows/product/reject-product.mdx +0 -48
  272. package/content/references/workflows/product/request-product-change.mdx +0 -48
  273. package/content/references/workflows/product-attribute/add-product-attributes-to-product.mdx +0 -49
  274. package/content/references/workflows/product-attribute/create-and-link-product-attributes-to-product.mdx +0 -46
  275. package/content/references/workflows/product-attribute/create-product-attribute-values.mdx +0 -43
  276. package/content/references/workflows/product-attribute/create-product-attributes.mdx +0 -56
  277. package/content/references/workflows/product-attribute/delete-product-attribute-values.mdx +0 -30
  278. package/content/references/workflows/product-attribute/delete-product-attributes.mdx +0 -30
  279. package/content/references/workflows/product-attribute/remove-product-attributes-from-product.mdx +0 -29
  280. package/content/references/workflows/product-attribute/update-product-attribute-values.mdx +0 -44
  281. package/content/references/workflows/product-attribute/update-product-attributes-on-product.mdx +0 -41
  282. package/content/references/workflows/product-attribute/update-product-attributes.mdx +0 -48
  283. package/content/references/workflows/product-attribute/upsert-product-attribute-values.mdx +0 -43
  284. package/content/references/workflows/product-edit/auto-confirm-product-change.mdx +0 -39
  285. package/content/references/workflows/product-edit/cancel-product-change.mdx +0 -49
  286. package/content/references/workflows/product-edit/confirm-product-change.mdx +0 -57
  287. package/content/references/workflows/product-edit/create-product-change.mdx +0 -72
  288. package/content/references/workflows/product-edit/reject-product-change.mdx +0 -54
  289. package/content/references/workflows/product-edit/stage-product-change.mdx +0 -75
  290. package/content/references/workflows/seller/approve-seller.mdx +0 -36
  291. package/content/references/workflows/seller/create-seller-account.mdx +0 -59
  292. package/content/references/workflows/seller/create-seller-defaults.mdx +0 -22
  293. package/content/references/workflows/seller/create-sellers.mdx +0 -65
  294. package/content/references/workflows/seller/delete-seller-professional-details.mdx +0 -37
  295. package/content/references/workflows/seller/delete-sellers.mdx +0 -24
  296. package/content/references/workflows/seller/invite-seller.mdx +0 -28
  297. package/content/references/workflows/seller/suspend-seller.mdx +0 -37
  298. package/content/references/workflows/seller/terminate-seller.mdx +0 -37
  299. package/content/references/workflows/seller/unsuspend-seller.mdx +0 -36
  300. package/content/references/workflows/seller/unterminate-seller.mdx +0 -36
  301. package/content/references/workflows/seller/update-seller-address.mdx +0 -55
  302. package/content/references/workflows/seller/update-seller-payment-details.mdx +0 -52
  303. package/content/references/workflows/seller/update-seller-professional-details.mdx +0 -48
  304. package/content/references/workflows/seller/update-sellers.mdx +0 -57
  305. package/content/resources/ai/llms.mdx +0 -74
  306. package/content/resources/integrations/notifications.mdx +0 -39
  307. package/content/resources/integrations/search.mdx +0 -122
  308. package/content/resources/tutorials/configure-commissions.mdx +0 -127
  309. package/content/resources/tutorials/first-marketplace.mdx +0 -45
  310. package/content/resources/tutorials/handle-product-requests.mdx +0 -80
  311. package/content/resources/tutorials/import-export-products.mdx +0 -96
  312. package/content/resources/tutorials/seller-payouts-stripe.mdx +0 -89
  313. package/content/resources/tutorials/store-setup-checklist.mdx +0 -214
  314. package/content/tools/api-client.mdx +0 -155
  315. package/content/tools/cli.mdx +0 -196
  316. package/content/tools/dashboard-sdk.mdx +0 -35
@@ -0,0 +1,123 @@
1
+ ---
2
+ title: "Self-host Mercur"
3
+ sidebarTitle: "Self-host"
4
+ description: "Deploy a Mercur marketplace to your own infrastructure: the API, the panels, and the databases behind them."
5
+ ---
6
+
7
+ This guide covers the general steps to self-host a Mercur marketplace. Mercur is a
8
+ Medusa plugin, so deployment follows Medusa's model, with one addition: the Vendor
9
+ panel is a separate app. Apply these steps to the hosting provider of your choice.
10
+
11
+ ## What you'll deploy
12
+
13
+ A Mercur marketplace has several parts.
14
+
15
+ - **PostgreSQL:** the primary database.
16
+ - **Redis:** session storage, the event bus, the workflow engine, and caching.
17
+ - **Mercur API:** a Medusa server running the Mercur plugin. You deploy it twice, one instance in server mode and one in worker mode.
18
+ - **Admin panel:** served by the API server.
19
+ - **Vendor panel:** a separate static app that talks to the Vendor API.
20
+ - **Storefront (optional):** your own frontend on the Store API.
21
+
22
+ Server mode handles API requests and serves the Admin panel. Worker mode runs
23
+ background work such as scheduled jobs and subscribers. Choose a host with at
24
+ least 2GB of RAM per instance.
25
+
26
+ ## 1. Configure the API for production
27
+
28
+ Set three values in `medusa-config.ts` so the same build can run as either a
29
+ server or a worker.
30
+
31
+ ```ts medusa-config.ts
32
+ module.exports = defineConfig({
33
+ projectConfig: {
34
+ // ...
35
+ redisUrl: process.env.REDIS_URL,
36
+ workerMode: process.env.MEDUSA_WORKER_MODE as "shared" | "worker" | "server",
37
+ },
38
+ admin: {
39
+ disable: process.env.DISABLE_MEDUSA_ADMIN === "true",
40
+ },
41
+ })
42
+ ```
43
+
44
+ The Admin panel is served by the server instance, so you disable it on the worker
45
+ instance. `redisUrl` moves sessions, events, and the workflow engine onto Redis.
46
+
47
+ ## 2. Add a predeploy script
48
+
49
+ Run migrations before the app starts in production. Add a `predeploy` script to
50
+ `package.json`.
51
+
52
+ ```json package.json
53
+ {
54
+ "scripts": {
55
+ "predeploy": "medusa db:migrate"
56
+ }
57
+ }
58
+ ```
59
+
60
+ ## 3. Use production modules
61
+
62
+ The default project ships modules meant for development, such as the local file
63
+ provider. Swap them for production-ready ones and register them alongside
64
+ `withMercur` in `medusa-config.ts`.
65
+
66
+ - **Redis cache, event bus, and workflow engine:** move caching, events, and workflow state off the local process.
67
+ - **Redis locking provider:** coordinate work safely across instances.
68
+ - **S3 file provider:** store uploads durably.
69
+ - **A notification provider** such as SendGrid or Resend, for transactional email.
70
+
71
+ ## 4. Set environment variables
72
+
73
+ Set these on each API instance.
74
+
75
+ | Variable | Description |
76
+ | --- | --- |
77
+ | `DATABASE_URL` | PostgreSQL connection string |
78
+ | `REDIS_URL` | Redis connection string |
79
+ | `JWT_SECRET` | Secret for signing auth tokens |
80
+ | `COOKIE_SECRET` | Secret for signing session cookies |
81
+ | `MEDUSA_WORKER_MODE` | `server` on the server instance, `worker` on the worker instance |
82
+ | `DISABLE_MEDUSA_ADMIN` | `false` on the server, `true` on the worker |
83
+ | `STORE_CORS` / `ADMIN_CORS` / `AUTH_CORS` | Allowed origins for the storefront, panels, and auth |
84
+
85
+ ## 5. Deploy the API
86
+
87
+ Deploy the same build as two instances.
88
+
89
+ <Steps>
90
+ <Step title="Build the app">
91
+ Run `bun run build` to compile the server and the Admin panel.
92
+ </Step>
93
+ <Step title="Run migrations">
94
+ The `predeploy` script runs `medusa db:migrate`. Run it once before starting.
95
+ </Step>
96
+ <Step title="Start the server instance">
97
+ Set `MEDUSA_WORKER_MODE=server` and `DISABLE_MEDUSA_ADMIN=false`. This instance serves the API and the Admin panel.
98
+ </Step>
99
+ <Step title="Start the worker instance">
100
+ Set `MEDUSA_WORKER_MODE=worker` and `DISABLE_MEDUSA_ADMIN=true`. This instance runs jobs and subscribers.
101
+ </Step>
102
+ </Steps>
103
+
104
+ ## 6. Deploy the Vendor panel
105
+
106
+ The Vendor panel is a separate Vite app. Build it with the API URL configured,
107
+ then host the static output on any static host or CDN.
108
+
109
+ <Note>
110
+ The Admin panel ships with the API server. The Vendor panel deploys on its own,
111
+ the same way a storefront does.
112
+ </Note>
113
+
114
+ ## Next steps
115
+
116
+ <CardGroup cols={2}>
117
+ <Card title="Medusa Cloud" icon="cloud" href="/resources/deployment/medusa-cloud">
118
+ Deploy without managing infrastructure yourself.
119
+ </Card>
120
+ <Card title="Stripe Connect" icon="credit-card" href="/resources/integrations/stripe-connect">
121
+ Wire up payments and payouts for production.
122
+ </Card>
123
+ </CardGroup>
@@ -0,0 +1,38 @@
1
+ ---
2
+ title: "Integrations"
3
+ sidebarTitle: "Overview"
4
+ description: "Extend Mercur with third-party providers and installable blocks."
5
+ ---
6
+
7
+ Mercur integrates with third-party providers to extend your marketplace. Payout
8
+ providers settle seller earnings, and installable blocks add extra capabilities on
9
+ top of the core platform.
10
+
11
+ ## Payout providers
12
+
13
+ A payout provider settles seller earnings to their connected accounts. Stripe
14
+ Connect ships out of the box. You can add your own provider against the same
15
+ interface.
16
+
17
+ <CardGroup cols={2}>
18
+ <Card title="Stripe Connect" icon="credit-card" href="/resources/integrations/stripe-connect">
19
+ Configure the Stripe Connect payout provider.
20
+ </Card>
21
+ <Card title="Payout module" icon="wallet" href="/platform/payout/overview">
22
+ Accounts, onboarding, and the transfer pipeline.
23
+ </Card>
24
+ </CardGroup>
25
+
26
+ ## Blocks
27
+
28
+ Other integrations ship as installable blocks. You add the block, own its source
29
+ in your project, and update it explicitly.
30
+
31
+ <CardGroup cols={2}>
32
+ <Card title="Add a Block" icon="cubes" href="/resources/tutorials/add-a-block">
33
+ Install a feature block into your project.
34
+ </Card>
35
+ <Card title="Build a Block" icon="hammer" href="/resources/tutorials/build-a-block">
36
+ Package your own feature as a distributable block.
37
+ </Card>
38
+ </CardGroup>
@@ -1,14 +1,15 @@
1
1
  ---
2
- title: "Stripe Connect Integration"
3
- description: "Set up Stripe Connect for marketplace payments and seller payouts — from Stripe Dashboard configuration to the full end-to-end payment lifecycle."
2
+ title: "Stripe Connect"
3
+ sidebarTitle: "Stripe Connect"
4
+ description: "Set up Stripe Connect for marketplace payments and seller payouts, from Stripe Dashboard configuration to the full end-to-end payment lifecycle."
4
5
  ---
5
6
 
6
7
  A Mercur marketplace needs **two** Stripe integrations working together. The first is the standard Medusa payment provider, which charges customers at checkout. The second is the Mercur payout provider, which transfers funds from the platform to sellers after orders are fulfilled.
7
8
 
8
- This guide covers both setting up Stripe, configuring both providers, wiring up webhooks, and understanding how money flows from customer to seller.
9
+ This guide covers both. It walks through setting up Stripe, configuring both providers, wiring up webhooks, and understanding how money flows from customer to seller.
9
10
 
10
11
  <Tip>
11
- This page is the configuration reference. For a hands-on walkthrough that takes one seller from onboarding to a settled payout, follow the [Set up seller payouts](/rc/resources/tutorials/seller-payouts-stripe) tutorial after completing the setup below.
12
+ This page is the configuration reference. For how payout accounts, onboarding, and the transfer pipeline work, see the [Payout](/platform/payout/overview) module.
12
13
  </Tip>
13
14
 
14
15
  <Info>
@@ -19,7 +20,7 @@ This guide covers both — setting up Stripe, configuring both providers, wiring
19
20
 
20
21
  - A [Stripe account](https://dashboard.stripe.com) with Connect enabled
21
22
  - Stripe Secret API key and Publishable API key
22
- - A running Mercur project ([installation guide](/rc/learn/installation))
23
+ - A running Mercur project ([installation guide](/learn/introduction))
23
24
  - Node.js 20+
24
25
 
25
26
  ## Architecture overview
@@ -51,8 +52,8 @@ The two integrations serve different purposes:
51
52
  <Step title="Find your API keys">
52
53
  Go to **Developers → API keys**. You'll need:
53
54
 
54
- - **Secret key** starts with `sk_test_` (test mode) or `sk_live_` (production)
55
- - **Publishable key** starts with `pk_test_` or `pk_live_`
55
+ - **Secret key:** starts with `sk_test_` (test mode) or `sk_live_` (production)
56
+ - **Publishable key:** starts with `pk_test_` or `pk_live_`
56
57
  </Step>
57
58
  <Step title="Set environment variables">
58
59
  Add the following to your `.env` file:
@@ -147,8 +148,8 @@ module.exports = defineConfig({
147
148
 
148
149
  | Option | Type | Default | Description |
149
150
  |--------|------|---------|-------------|
150
- | `apiKey` | `string` | | Stripe secret API key |
151
- | `webhookSecret` | `string` | | Signing secret for the payout webhook endpoint |
151
+ | `apiKey` | `string` | - | Stripe secret API key |
152
+ | `webhookSecret` | `string` | - | Signing secret for the payout webhook endpoint |
152
153
  | `accountValidation` | `object` | See below | Controls when a connected account is considered `ACTIVE` |
153
154
 
154
155
  ### Account validation options
@@ -172,12 +173,12 @@ The payout module itself accepts timing options that control the capture and pay
172
173
  | `disabled` | `boolean` | `false` | Disable automatic capture checks and daily payout jobs |
173
174
  | `authorizationWindowMs` | `number` | `604800000` (7 days) | How long a payment authorization remains valid |
174
175
  | `sellerActionWindowMs` | `number` | `259200000` (72 hours) | How long sellers have to accept/fulfill before cancellation |
175
- | `captureSafetyBufferMs` | `number` | `86400000` (24 hours) | Safety margin before authorization expiry capture happens before `authorization expiry - buffer` |
176
+ | `captureSafetyBufferMs` | `number` | `86400000` (24 hours) | Safety margin before authorization expiry. Capture happens before `authorization expiry - buffer` |
176
177
  | `requiredFulfillmentStatus` | `string` | `"fulfilled"` | Minimum fulfillment status before an order is eligible for capture |
177
178
 
178
179
  ## Set up webhooks
179
180
 
180
- You need **two separate webhook endpoints** in Stripe one for payment events, one for payout events.
181
+ You need **two separate webhook endpoints** in Stripe: one for payment events, one for payout events.
181
182
 
182
183
  <Warning>
183
184
  These are two distinct webhook endpoints, each with its own signing secret. Do not combine them into a single endpoint.
@@ -216,19 +217,19 @@ Here's a concrete example. A customer buys items from two sellers:
216
217
  - **Shipping**: €10
217
218
  - **Cart total**: €80
218
219
 
219
- ### Step 1 Authorize payment
220
+ ### Step 1: Authorize payment
220
221
 
221
- At checkout, a single `PaymentIntent` is created for €80 with `capture_method: "manual"`. The customer authenticates once (SCA-compliant). No money moves yet the funds are held on the customer's card.
222
+ At checkout, a single `PaymentIntent` is created for €80 with `capture_method: "manual"`. The customer authenticates once (SCA-compliant). No money moves yet. The funds are held on the customer's card.
222
223
 
223
- ### Step 2 Split orders
224
+ ### Step 2: Split orders
224
225
 
225
- Mercur's `completeCartWithSplitOrdersWorkflow` groups items by seller and creates separate orders one for Seller A (€40) and one for Seller B (€30), plus shipping allocation.
226
+ Mercur's `completeCartWithSplitOrdersWorkflow` groups items by seller and creates separate orders: one for Seller A (€40) and one for Seller B (€30), plus shipping allocation.
226
227
 
227
- ### Step 3 Seller acceptance and fulfillment
228
+ ### Step 3: Seller acceptance and fulfillment
228
229
 
229
230
  Each seller reviews and fulfills their order through the Vendor Portal. The payout module's `sellerActionWindowMs` (default: 72 hours) defines how long sellers have to act.
230
231
 
231
- ### Step 4 Capture payment
232
+ ### Step 4: Capture payment
232
233
 
233
234
  Once orders meet the `requiredFulfillmentStatus` (default: `"fulfilled"`), the platform captures the authorized payment. The capture-check job runs automatically and respects the `captureSafetyBufferMs` to ensure capture happens before authorization expiry.
234
235
 
@@ -236,7 +237,7 @@ Once orders meet the `requiredFulfillmentStatus` (default: `"fulfilled"`), the p
236
237
  Card authorizations typically expire after **7 days**. The default configuration gives sellers 72 hours to fulfill, with a 24-hour safety buffer before capture. If your business requires longer seller action windows, consider whether the 7-day authorization window is sufficient.
237
238
  </Warning>
238
239
 
239
- ### Step 5 Commission calculation and transfers
240
+ ### Step 5: Commission calculation and transfers
240
241
 
241
242
  After capture, Mercur calculates commission for each order and creates Stripe Transfers for the net amounts:
242
243
 
@@ -247,7 +248,7 @@ Seller B net = €30 - commission
247
248
 
248
249
  Each transfer is linked to the original charge via `source_transaction` and grouped by `transfer_group` (the order ID).
249
250
 
250
- ### Step 6 Bank payouts
251
+ ### Step 6: Bank payouts
251
252
 
252
253
  Stripe automatically pays out connected account balances to sellers' bank accounts on the configured payout schedule. Mercur tracks payout status changes via the `account.updated` webhook.
253
254
 
@@ -263,16 +264,16 @@ PENDING → (Stripe onboarding) → ACTIVE
263
264
  REJECTED (permanent)
264
265
  ```
265
266
 
266
- 1. **Account creation** Mercur calls `stripe.accounts.create({ type: "express" })`, creating a Stripe Express connected account. The payout account starts in `PENDING` status.
267
+ 1. **Account creation.** Mercur calls `stripe.accounts.create({ type: "express" })`, creating a Stripe Express connected account. The payout account starts in `PENDING` status.
267
268
 
268
- 2. **Onboarding link** The seller receives a Stripe-hosted onboarding URL via `stripe.accountLinks.create()`. They complete identity verification, bank account setup, and any required compliance steps directly on Stripe.
269
+ 2. **Onboarding link.** The seller receives a Stripe-hosted onboarding URL via `stripe.accountLinks.create()`. They complete identity verification, bank account setup, and any required compliance steps directly on Stripe.
269
270
 
270
- 3. **Webhook activation** When the seller completes onboarding, Stripe sends an `account.updated` webhook. The provider evaluates the account against the `accountValidation` options and transitions the status:
271
+ 3. **Webhook activation.** When the seller completes onboarding, Stripe sends an `account.updated` webhook. The provider evaluates the account against the `accountValidation` options and transitions the status:
271
272
  - All validation checks pass → `ACTIVE`
272
273
  - Missing requirements or disabled reason → `RESTRICTED`
273
274
  - Disabled reason starts with `rejected.` → `REJECTED`
274
275
 
275
- 4. **Ongoing monitoring** Stripe may send additional `account.updated` events if requirements change. The provider re-evaluates and updates the status accordingly.
276
+ 4. **Ongoing monitoring.** Stripe may send additional `account.updated` events if requirements change. The provider re-evaluates and updates the status accordingly.
276
277
 
277
278
  For more details on payout accounts, balances, and transactions, see [Payout](/rc/learn/payouts).
278
279
 
@@ -284,7 +285,7 @@ Stripe uses two distinct concepts for moving money, and it's important to unders
284
285
  |---|---|---|
285
286
  | **What it does** | Moves funds from platform balance to connected account balance | Moves funds from connected account balance to seller's bank account |
286
287
  | **Speed** | Instant ledger movement | 1–3 business days (varies by country) |
287
- | **Status lifecycle** | None transfers are immediate | `pending` → `in_transit` → `paid` / `failed` |
288
+ | **Status lifecycle** | None. Transfers are immediate | `pending` → `in_transit` → `paid` / `failed` |
288
289
  | **Who triggers it** | Mercur (via `stripe.transfers.create()`) | Stripe (on the connected account's payout schedule) |
289
290
  | **Mercur tracking** | Transfer created with status `PAID` immediately | Status tracked via webhooks |
290
291
 
@@ -294,8 +295,8 @@ When Mercur's `createPayout` method is called, the Stripe Connect provider creat
294
295
 
295
296
  Refunding a charge does **not** automatically reverse the associated transfers. These are two separate operations:
296
297
 
297
- 1. **Refund the PaymentIntent** Returns funds to the customer's payment method
298
- 2. **Reverse the Transfer(s)** Claws back funds from the connected account(s)
298
+ 1. **Refund the PaymentIntent.** Returns funds to the customer's payment method
299
+ 2. **Reverse the Transfer(s).** Claws back funds from the connected account(s)
299
300
 
300
301
  For a full refund of a multi-seller order, you would need to reverse each seller's transfer individually. For partial refunds, you need to calculate how much to reverse from each seller based on which items are being refunded.
301
302
 
@@ -343,13 +344,13 @@ Use Stripe test mode keys (`sk_test_`, `pk_test_`) during development. All conne
343
344
 
344
345
  ### Webhook forwarding with Stripe CLI
345
346
 
346
- Since webhooks need to reach your local machine during development, use the [Stripe CLI](https://docs.stripe.com/stripe-cli) to forward events. You need **two separate listeners** one for each webhook endpoint:
347
+ Since webhooks need to reach your local machine during development, use the [Stripe CLI](https://docs.stripe.com/stripe-cli) to forward events. You need **two separate listeners**, one for each webhook endpoint:
347
348
 
348
349
  ```bash
349
- # Terminal 1 Payment webhooks
350
+ # Terminal 1: Payment webhooks
350
351
  stripe listen --forward-to localhost:9000/hooks/payment/stripe_stripe
351
352
 
352
- # Terminal 2 Payout webhooks
353
+ # Terminal 2: Payout webhooks
353
354
  stripe listen --forward-to localhost:9000/hooks/payout
354
355
  ```
355
356
 
@@ -370,26 +371,26 @@ stripe listen --forward-to localhost:9000/hooks/payout
370
371
 
371
372
  <AccordionGroup>
372
373
  <Accordion title="Why do I need two webhook endpoints with two secrets?">
373
- They belong to two different integrations: the payment webhook feeds Medusa's payment provider (charges, captures, refunds), while the payout webhook feeds Mercur's payout provider (connected-account status, transfer status). Each endpoint verifies its own signing secret combining them silently breaks whichever side's signature doesn't match.
374
+ They belong to two different integrations: the payment webhook feeds Medusa's payment provider (charges, captures, refunds), while the payout webhook feeds Mercur's payout provider (connected-account status, transfer status). Each endpoint verifies its own signing secret. Combining them silently breaks whichever side's signature doesn't match.
374
375
  </Accordion>
375
376
  <Accordion title="Why must capture be set to false on the payment provider?">
376
- The marketplace flow authorizes at checkout and captures later, after sellers fulfill. Automatic capture would take the money before the split-order pipeline (fulfillment checks, commission, payouts) has run `capture: false` hands that timing to the payout module's capture job.
377
+ The marketplace flow authorizes at checkout and captures later, after sellers fulfill. Automatic capture would take the money before the split-order pipeline (fulfillment checks, commission, payouts) has run. `capture: false` hands that timing to the payout module's capture job.
377
378
  </Accordion>
378
- <Accordion title="A seller finished Stripe onboarding but is still not ACTIVE — why?">
379
- Check the `accountValidation` options: by default the account must have details submitted, charges and payouts enabled, and **no outstanding requirements**. Stripe often adds follow-up requirements (e.g. extra KYC) after initial onboarding the account shows as `RESTRICTED` until they're cleared.
379
+ <Accordion title="A seller finished Stripe onboarding but is still not ACTIVE. Why?">
380
+ Check the `accountValidation` options: by default the account must have details submitted, charges and payouts enabled, and **no outstanding requirements**. Stripe often adds follow-up requirements (e.g. extra KYC) after initial onboarding. The account shows as `RESTRICTED` until they're cleared.
380
381
  </Accordion>
381
382
  <Accordion title="Who handles VAT, disputes, and chargebacks?">
382
- The platform. Separate Charges and Transfers makes the platform the Merchant of Record see [EU/EEA considerations](#eueea-considerations) for what that entails.
383
+ The platform. Separate Charges and Transfers makes the platform the Merchant of Record. See [EU/EEA considerations](#eueea-considerations) for what that entails.
383
384
  </Accordion>
384
385
  </AccordionGroup>
385
386
 
386
387
  ## Next steps
387
388
 
388
389
  <CardGroup cols={2}>
389
- <Card title="Set up seller payouts" href="/rc/resources/tutorials/seller-payouts-stripe">
390
- Hands-on: one seller from onboarding to a settled payout.
390
+ <Card title="Payout" href="/platform/payout/overview">
391
+ Payout accounts, onboarding, and the transfer pipeline.
391
392
  </Card>
392
- <Card title="Payout" href="/rc/learn/payouts">
393
- The pipeline reference — statuses, jobs, and webhook events.
393
+ <Card title="The payout pipeline" href="/platform/payout/concepts/payout-pipeline">
394
+ Statuses, jobs, and webhook events.
394
395
  </Card>
395
396
  </CardGroup>
@@ -1,25 +1,28 @@
1
1
  ---
2
- title: "Add a feature with a block"
3
- description: "Install the reviews block end-to-end and see it live across the admin, vendor, and storefront surfaces."
2
+ title: "How to Add a Block"
3
+ sidebarTitle: "Add a Block"
4
+ description: "Install the reviews block end-to-end and follow it live across the admin, vendor, and storefront surfaces."
4
5
  ---
5
6
 
6
- Blocks are complete features — backend module, workflows, API routes, and panel UI — installed as **source code** into your project. This tutorial installs the `reviews` block and follows it across every surface it touches.
7
+ Install a block and see the feature running on every surface it touches.
8
+
9
+ Blocks are complete features installed as **source code** into your project. A block bundles the backend module, workflows, API routes, and panel UI. This tutorial installs the `reviews` block and follows it across each surface it appears on.
7
10
 
8
11
  <Info>
9
- **Blocks are copied, not installed as dependencies.** `add` writes the block's source files into your project via the aliases in `blocks.json` you own and can edit every file afterwards. Updates are opt-in through `diff` and `add --overwrite`. When you outgrow the catalog, [build your own block](/rc/resources/tutorials/build-a-block).
12
+ Blocks are copied, not installed as dependencies. `add` writes the block's source files into your project through the aliases in `blocks.json`. You own and can edit every file afterwards. Updates are opt-in through `diff` and `add --overwrite`. When you outgrow the catalog, [build your own block](/rc/resources/tutorials/build-a-block).
10
13
  </Info>
11
14
 
12
15
  ## Goal
13
16
 
14
- Install reviews as a block and see it running everywhere it appears.
17
+ Install reviews as a block and confirm it runs everywhere it appears.
15
18
 
16
19
  ## Install the block
17
20
 
18
21
  <Steps>
19
22
  <Step title="Discover the block">
20
- Search the registry and inspect what the block ships before installing:
23
+ Search the registry and inspect what the block ships before you install it.
21
24
 
22
- ```bash
25
+ ```bash Terminal
23
26
  bunx @mercurjs/cli@latest search --query reviews
24
27
  bunx @mercurjs/cli@latest view reviews
25
28
  ```
@@ -27,16 +30,18 @@ Install reviews as a block and see it running everywhere it appears.
27
30
  `view` lists the block's files by target (API, admin, vendor) and its dependencies.
28
31
  </Step>
29
32
  <Step title="Install it">
30
- ```bash
33
+ Run `add` to copy the block into your project.
34
+
35
+ ```bash Terminal
31
36
  bunx @mercurjs/cli@latest add reviews
32
37
  ```
33
38
 
34
- The CLI copies the source into the directories mapped by your `blocks.json` aliases and prints the block's post-install instructions module registration, middlewares, migrations.
39
+ The CLI copies the source into the directories mapped by your `blocks.json` aliases and prints the block's post-install instructions: module registration, middlewares, and migrations.
35
40
  </Step>
36
41
  <Step title="Run migrations and codegen">
37
- The block introduced a reviews module, so generate and run its migrations, then refresh the typed route map:
42
+ The block introduced a reviews module. Generate and run its migrations, then refresh the typed route map.
38
43
 
39
- ```bash
44
+ ```bash Terminal
40
45
  cd packages/api
41
46
  bunx medusa db:generate reviews
42
47
  bunx medusa db:migrate
@@ -44,25 +49,27 @@ Install reviews as a block and see it running everywhere it appears.
44
49
  ```
45
50
  </Step>
46
51
  <Step title="See it live">
47
- Start the project reviews now appear in the admin panel (moderation), the vendor portal (per-seller reviews), and the Store API (customer-facing review routes).
52
+ Start the project. Reviews now appear in the admin panel (moderation), the vendor portal (per-seller reviews), and the Store API (customer-facing review routes).
48
53
  </Step>
49
54
  </Steps>
50
55
 
51
56
  ## Verify
52
57
 
53
- 1. The block's files exist in your repo under the alias-mapped paths.
54
- 2. Migrations ran cleanly and the API boots.
55
- 3. The admin and vendor panels show their reviews pages; the store review endpoints respond.
56
- 4. `bunx @mercurjs/cli@latest diff reviews` reports no drift from the registry.
58
+ Check that the install landed cleanly:
59
+
60
+ - **Files:** the block's files exist in your repo under the alias-mapped paths.
61
+ - **API:** migrations ran cleanly and the API boots.
62
+ - **Panels and store:** the admin and vendor panels show their reviews pages, and the store review endpoints respond.
63
+ - **No drift:** `bunx @mercurjs/cli@latest diff reviews` reports no drift from the registry.
57
64
 
58
65
  ## FAQ
59
66
 
60
67
  <AccordionGroup>
61
68
  <Accordion title="What if I've already modified files the block wants to write?">
62
- The CLI asks before overwriting existing files (or force it with `--overwrite`). If you've customized a page the block also ships, merge by hand you're merging source, not resolving package versions.
69
+ The CLI asks before overwriting existing files, or you can force it with `--overwrite`. If you have customized a page the block also ships, merge by hand. You are merging source, not resolving package versions.
63
70
  </Accordion>
64
71
  <Accordion title="How do I update a block later?">
65
- `bunx @mercurjs/cli@latest diff reviews` shows what changed in the registry since you installed. Take updates with `add reviews --overwrite`, re-applying any local edits afterwards.
72
+ `bunx @mercurjs/cli@latest diff reviews` shows what changed in the registry since you installed. Take updates with `add reviews --overwrite`, then re-apply any local edits afterwards.
66
73
  </Accordion>
67
74
  </AccordionGroup>
68
75
 
@@ -1,33 +1,38 @@
1
1
  ---
2
- title: "Add a widget"
3
- description: "Inject a React component at a named zone on a built-in panel page with defineWidgetConfig — no forking."
2
+ title: "How to Add a Widget"
3
+ sidebarTitle: "Add a Widget"
4
+ description: "Render your own React component in a named zone on a built-in panel page without forking it."
4
5
  ---
5
6
 
6
- A **widget** is a React component attached to a named zone on a built-in page. You drop one file under `src/widgets/`, and the SDK renders it at that zone while the rest of the page — its data fetching, filters, pagination — stays exactly as shipped. This is the lightest way to add UI to a page you don't own.
7
+ A widget is a React component attached to a named zone on a built-in page. You drop one file under `src/widgets/`, and the SDK renders it at that zone while the rest of the page stays exactly as shipped, including its data fetching, filters, and pagination.
8
+
9
+ This is the lightest way to add UI to a page you don't own. Reach for it first when you want to add something to an existing screen.
7
10
 
8
11
  <Info>
9
- **Additive, not a replacement.** Unlike a drop-in route (which owns the whole page), a widget layers your component onto the built-in page at a documented zone. Reach for this first when you just want to *add* something to an existing screen.
12
+ A widget is additive, not a replacement. Unlike a drop-in route, which owns the whole page, a widget layers your component onto the built-in page at a documented zone.
10
13
  </Info>
11
14
 
12
15
  ## What you'll build
13
16
 
14
- A tip banner above the vendor product list, rendered from a single file with the list itself untouched.
17
+ A tip banner above the vendor product list, rendered from a single file, with the list itself untouched.
15
18
 
16
- ## Register the typed targets (once)
19
+ ## Register the typed targets
17
20
 
18
- Widget zones are typed ids that the vendor panel generates from its own pages and ships as `@mercurjs/vendor/extension-targets`. Register them once so the ids resolve everywhere, with a single ambient reference in your app's `src`:
21
+ Widget zones are typed ids that the vendor panel generates from its own pages and ships as `@mercurjs/vendor/extension-targets`. Register them once so the ids resolve everywhere, with a single ambient reference in your app's `src`.
19
22
 
20
23
  ```typescript apps/vendor/src/extension-targets.d.ts
21
24
  /// <reference types="@mercurjs/vendor/extension-targets" />
22
25
  ```
23
26
 
24
- Projects from `create-mercur-app` already ship this file. With it present, an invalid zone fails `tsc` instead of silently doing nothing.
27
+ <Note>
28
+ Projects from `create-mercur-app` already ship this file. With it present, an invalid zone fails `tsc` instead of silently doing nothing.
29
+ </Note>
25
30
 
26
31
  ## Add the widget
27
32
 
28
33
  <Steps>
29
34
  <Step title="Create the widget file">
30
- Drop a file under `src/widgets/`. Export the component as the **default** and a `config` built with `defineWidgetConfig`. The `zone` names where it renders:
35
+ Drop a file under `src/widgets/`. Export the component as the default and a `config` built with `defineWidgetConfig`. The `zone` names where it renders.
31
36
 
32
37
  ```tsx apps/vendor/src/widgets/product-list-banner.tsx
33
38
  import { defineWidgetConfig } from "@mercurjs/dashboard-sdk"
@@ -49,52 +54,56 @@ Projects from `create-mercur-app` already ship this file. With it present, an in
49
54
  ```
50
55
  </Step>
51
56
  <Step title="Understand the zone id">
52
- A zone id is `<domain>.<view>.<placement>`. The last segment is the placement:
57
+ A zone id reads `<domain>.<view>.<placement>`. The last segment is the placement.
53
58
 
54
59
  | Placement | Effect |
55
60
  |-----------|--------|
56
61
  | `before` | Renders before the built-in content of the zone |
57
62
  | `after` | Renders after the built-in content |
58
63
 
59
- Multiple `before` / `after` widgets on the same zone stack in registration order.
64
+ Multiple `before` or `after` widgets on the same zone stack in registration order.
60
65
  </Step>
61
66
  <Step title="Reload the panel">
62
- Start the project (`bun run dev`) and open the vendor portal. Widget files hot-reload the banner appears above the product list, and the table below it works exactly as before.
67
+ Start the project and open the vendor portal. Widget files hot-reload. The banner appears above the product list, and the table below it works exactly as before.
68
+
69
+ ```bash Terminal
70
+ bun run dev
71
+ ```
63
72
  </Step>
64
73
  </Steps>
65
74
 
66
75
  ## Available zones
67
76
 
68
- Zones mounted today in the **vendor portal**:
77
+ These zones are mounted today in the vendor portal.
69
78
 
70
79
  | Zone | Where it renders |
71
80
  |------|------------------|
72
81
  | `product.list.before` / `.after` | Vendor product list page |
73
- | `seller.setup.before` / `.after` | The store-setup / onboarding surface (dashboard home + store settings), passed the `seller` as `data` |
82
+ | `seller.setup.before` / `.after` | The store-setup and onboarding surface (dashboard home plus store settings), passed the `seller` as `data` |
74
83
  | `login.logo.*` | The logo slot on the public login screen |
75
- | `login.before.*` / `login.after.*` | Around the login form (rendered before authentication) |
84
+ | `login.before.*` / `login.after.*` | Around the login form, rendered before authentication |
76
85
 
77
- The full, valid set is typed as `WidgetZoneId` and generated into `@mercurjs/vendor/extension-targets` from the panel's own zone hosts let your editor autocomplete `zone:` to see every option. A zone no page renders can't be targeted and won't type-check.
86
+ The full, valid set is typed as `WidgetZoneId` and generated into `@mercurjs/vendor/extension-targets` from the panel's own zone hosts. Let your editor autocomplete `zone:` to see every option. A zone no page renders can't be targeted and won't type-check.
78
87
 
79
88
  ## Verify
80
89
 
81
90
  1. The tip banner renders above the product list.
82
- 2. Search, filter, and paginate the list all built-in behavior still works.
83
- 3. Change the zone to `product.list.after` and reload the banner moves below the list.
84
- 4. Set `zone: "not.a.zone"` `tsc` (`bun run lint`) fails with a "not assignable to `WidgetZoneId`" error.
85
- 5. Delete the file the banner disappears; nothing else changed.
91
+ 2. Search, filter, and paginate the list. All built-in behavior still works.
92
+ 3. Change the zone to `product.list.after` and reload. The banner moves below the list.
93
+ 4. Set `zone: "not.a.zone"`. `tsc` (`bun run lint`) fails with a "not assignable to `WidgetZoneId`" error.
94
+ 5. Delete the file. The banner disappears, and nothing else changes.
86
95
 
87
96
  ## FAQ
88
97
 
89
98
  <AccordionGroup>
90
99
  <Accordion title="Can a widget target more than one zone?">
91
- Yes `zone` accepts an array (`zone: ["product.list.before", "login.after.before"]`), and the same component renders at each.
100
+ Yes. `zone` accepts an array (`zone: ["product.list.before", "login.after.before"]`), and the same component renders at each.
92
101
  </Accordion>
93
102
  <Accordion title="Can a block ship widgets?">
94
- Yes. A [block](/rc/learn/blocks) can include `src/widgets/` files in its `vendor_ui` / `admin_ui` entry, and they're aggregated just like the host app's installing the block adds the widget with no wiring.
103
+ Yes. A [block](/rc/learn/blocks) can include `src/widgets/` files in its `vendor_ui` or `admin_ui` entry, and they're aggregated just like the host app's. Installing the block adds the widget with no wiring.
95
104
  </Accordion>
96
105
  <Accordion title="Does the admin panel have widget zones too?">
97
- The zone set is per panel and generated from each panel's pages. Today the mounted zones live in the vendor portal (`product.list.*`, `login.*`); the admin panel exposes navigation and product custom fields. Check `@mercurjs/admin/extension-targets` for its current zones.
106
+ The zone set is per panel and generated from each panel's pages. Today the mounted zones live in the vendor portal (`product.list.*`, `login.*`). The admin panel exposes navigation and product custom fields. Check `@mercurjs/admin/extension-targets` for its current zones.
98
107
  </Accordion>
99
108
  </AccordionGroup>
100
109