@wix/agent-skills 1.13.0 → 1.15.0

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 (250) hide show
  1. package/README.md +4 -1
  2. package/package.json +1 -1
  3. package/skills/README.md +23 -0
  4. package/skills/wix-app/SKILL.md +10 -2
  5. package/skills/wix-app/references/AUTO_PATTERNS_DASHBOARD.md +326 -0
  6. package/skills/wix-app/references/CODE_QUALITY.md +1 -0
  7. package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +124 -115
  8. package/skills/wix-app/references/DASHBOARD_PAGE.md +3 -0
  9. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +23 -9
  10. package/skills/wix-app/references/SITE_PLUGIN.md +1 -1
  11. package/skills/wix-app/references/auto-patterns-dashboard/action-cell.md +115 -0
  12. package/skills/wix-app/references/auto-patterns-dashboard/app-config-structure.md +264 -0
  13. package/skills/wix-app/references/auto-patterns-dashboard/app-context.md +37 -0
  14. package/skills/wix-app/references/auto-patterns-dashboard/bulk-actions.md +86 -0
  15. package/skills/wix-app/references/auto-patterns-dashboard/collection-page-actions.md +119 -0
  16. package/skills/wix-app/references/auto-patterns-dashboard/collection-page.md +103 -0
  17. package/skills/wix-app/references/auto-patterns-dashboard/custom-actions-override.md +76 -0
  18. package/skills/wix-app/references/auto-patterns-dashboard/custom-columns-override.md +82 -0
  19. package/skills/wix-app/references/auto-patterns-dashboard/custom-components-override.md +89 -0
  20. package/skills/wix-app/references/auto-patterns-dashboard/custom-header-override.md +124 -0
  21. package/skills/wix-app/references/auto-patterns-dashboard/custom-sections-override.md +91 -0
  22. package/skills/wix-app/references/auto-patterns-dashboard/custom-slots-override.md +71 -0
  23. package/skills/wix-app/references/auto-patterns-dashboard/entity-page-actions.md +70 -0
  24. package/skills/wix-app/references/auto-patterns-dashboard/entity-page-view-actions.md +73 -0
  25. package/skills/wix-app/references/auto-patterns-dashboard/entity-page.md +98 -0
  26. package/skills/wix-app/references/auto-patterns-dashboard/example-patterns.json +278 -0
  27. package/skills/wix-app/references/auto-patterns-dashboard/pages-configuration.md +94 -0
  28. package/skills/wix-app/references/auto-patterns-dashboard/resolved-action.md +43 -0
  29. package/skills/wix-app/references/auto-patterns-dashboard/sdk-utilities.md +66 -0
  30. package/skills/wix-app/references/auto-patterns-dashboard/views.md +76 -0
  31. package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +1 -14
  32. package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +54 -29
  33. package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +2 -2
  34. package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +17 -105
  35. package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +127 -0
  36. package/skills/wix-app/references/editor-react-component/PARTS.md +2 -1
  37. package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +15 -15
  38. package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +25 -53
  39. package/skills/wix-app/scripts/generate-auto-patterns.js +510 -0
  40. package/skills/wix-auth/SKILL.md +12 -0
  41. package/skills/wix-auth/references/device-flow.md +140 -0
  42. package/skills/wix-docs/SKILL.md +188 -0
  43. package/skills/wix-docs/references/API_SPEC_SEARCH.md +213 -0
  44. package/skills/wix-docs/references/EXTRACTING.md +120 -0
  45. package/skills/wix-headless/SKILL.md +84 -130
  46. package/skills/wix-headless/entry/bootstrap.mjs +93 -0
  47. package/skills/wix-headless/entry/skill.md +78 -0
  48. package/skills/wix-headless/references/AI_FEATURES.md +178 -0
  49. package/skills/wix-headless/references/CAPABILITIES.md +84 -0
  50. package/skills/wix-headless/references/DISCOVERY.md +34 -56
  51. package/skills/wix-headless/references/DOC_DISCOVERY.md +37 -0
  52. package/skills/wix-headless/references/FEEDBACK.md +118 -0
  53. package/skills/wix-headless/references/IMAGE_GENERATION.md +69 -0
  54. package/skills/wix-headless/references/SDK_HANDOFF.md +97 -0
  55. package/skills/wix-headless/references/SEED.md +44 -188
  56. package/skills/wix-headless/references/SETUP.md +32 -103
  57. package/skills/wix-headless/references/astro.md +98 -0
  58. package/skills/wix-headless/references/inline-recipes/how-to-code-a-blog.md +196 -0
  59. package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +236 -0
  60. package/skills/wix-headless/references/inline-recipes/how-to-code-bookings.md +279 -0
  61. package/skills/wix-headless/references/inline-recipes/how-to-code-cms.md +163 -0
  62. package/skills/wix-headless/references/inline-recipes/how-to-code-events.md +203 -0
  63. package/skills/wix-headless/references/inline-recipes/how-to-code-forms.md +222 -0
  64. package/skills/wix-headless/references/inline-recipes/how-to-code-members-astro.md +124 -0
  65. package/skills/wix-headless/references/inline-recipes/how-to-code-members-custom-login.md +160 -0
  66. package/skills/wix-headless/references/inline-recipes/how-to-code-members-non-astro.md +118 -0
  67. package/skills/wix-headless/references/inline-recipes/how-to-code-portfolio.md +132 -0
  68. package/skills/wix-headless/references/inline-recipes/how-to-code-pricing-plans.md +124 -0
  69. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-orders.md +188 -0
  70. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-reservations.md +173 -0
  71. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurants.md +161 -0
  72. package/skills/wix-headless/references/inline-recipes/setup-blog.md +175 -0
  73. package/skills/wix-headless/references/inline-recipes/setup-bookings.md +228 -0
  74. package/skills/wix-headless/references/inline-recipes/setup-cms.md +200 -0
  75. package/skills/wix-headless/references/inline-recipes/setup-events.md +196 -0
  76. package/skills/wix-headless/references/inline-recipes/setup-forms.md +174 -0
  77. package/skills/wix-headless/references/inline-recipes/setup-online-store.md +176 -0
  78. package/skills/wix-headless/references/inline-recipes/setup-portfolio.md +153 -0
  79. package/skills/wix-headless/references/inline-recipes/setup-pricing-plans.md +229 -0
  80. package/skills/wix-headless/references/inline-recipes/setup-restaurant-orders.md +161 -0
  81. package/skills/wix-headless/references/inline-recipes/setup-restaurant-reservations.md +117 -0
  82. package/skills/wix-headless/references/inline-recipes/setup-restaurants.md +152 -0
  83. package/skills/wix-headless/references/managed/AUTHENTICATION.md +57 -0
  84. package/skills/wix-headless/references/managed/CONNECT.md +74 -0
  85. package/skills/wix-headless/references/managed/CREATE.md +130 -0
  86. package/skills/wix-headless/references/managed/DEPLOYMENT.md +57 -0
  87. package/skills/wix-headless/references/non-astro.md +59 -0
  88. package/skills/wix-headless/references/self-managed/AUTHENTICATION.md +22 -0
  89. package/skills/wix-headless/references/self-managed/DEPLOYMENT.md +7 -0
  90. package/skills/wix-headless/references/stripe/AUTHENTICATION.md +55 -0
  91. package/skills/wix-headless/references/stripe/DEPLOYMENT.md +63 -0
  92. package/skills/wix-manage/SKILL.md +24 -1
  93. package/skills/wix-manage/references/analytics/query-site-analytics.md +241 -0
  94. package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +1 -1
  95. package/skills/wix-manage/references/bookings/diagnose-availability-issues.md +265 -0
  96. package/skills/wix-manage/references/marketing/create-and-publish-social-post.md +436 -0
  97. package/skills/wix-manage/references/marketing/generate-and-publish-marketing-plan.md +209 -0
  98. package/skills/wix-manage/references/rich-content/author-ricos-rich-content.md +249 -0
  99. package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +51 -0
  100. package/skills/wix-vibe-headless/SKILL.md +136 -0
  101. package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +128 -0
  102. package/skills/wix-vibe-headless/references/blog/wix-blog.js +217 -0
  103. package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +153 -0
  104. package/skills/wix-vibe-headless/references/bookings/wix-bookings-checkout.js +147 -0
  105. package/skills/wix-vibe-headless/references/bookings/wix-bookings-services.js +215 -0
  106. package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +154 -0
  107. package/skills/wix-vibe-headless/references/cms/wix-cms.js +186 -0
  108. package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +142 -0
  109. package/skills/wix-vibe-headless/references/events/wix-events-browse.js +135 -0
  110. package/skills/wix-vibe-headless/references/events/wix-events-registration.js +187 -0
  111. package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +211 -0
  112. package/skills/wix-vibe-headless/references/members/wix-members-auth.js +387 -0
  113. package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +111 -0
  114. package/skills/wix-vibe-headless/references/portfolio/wix-portfolio.js +194 -0
  115. package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +127 -0
  116. package/skills/wix-vibe-headless/references/pricing-plans/wix-pricing-plans.js +157 -0
  117. package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +138 -0
  118. package/skills/wix-vibe-headless/references/restaurants/wix-restaurants-menu.js +224 -0
  119. package/skills/wix-vibe-headless/references/restaurants/wix-restaurants-ordering.js +156 -0
  120. package/skills/wix-vibe-headless/references/restaurants/wix-restaurants-reservations.js +107 -0
  121. package/skills/wix-vibe-headless/references/shared/wix-client.js +186 -0
  122. package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +155 -0
  123. package/skills/wix-vibe-headless/references/storefront/wix-store-cart.js +147 -0
  124. package/skills/wix-vibe-headless/references/storefront/wix-store-catalog.js +142 -0
  125. package/skills/wix-headless/references/BUILD-astro.md +0 -244
  126. package/skills/wix-headless/references/BUILD-own-build.md +0 -167
  127. package/skills/wix-headless/references/BUILD.md +0 -105
  128. package/skills/wix-headless/references/DESIGN_SYSTEM.md +0 -165
  129. package/skills/wix-headless/references/DISCOVERY-connect.md +0 -55
  130. package/skills/wix-headless/references/DISCOVERY-create.md +0 -238
  131. package/skills/wix-headless/references/PLAN-connect.md +0 -19
  132. package/skills/wix-headless/references/PLAN-create.md +0 -17
  133. package/skills/wix-headless/references/PLAN.md +0 -92
  134. package/skills/wix-headless/references/astro/blog/BLOG_PAGES.md +0 -300
  135. package/skills/wix-headless/references/astro/blog/BLOG_SETUP.md +0 -218
  136. package/skills/wix-headless/references/astro/bookings/COMPONENTS.md +0 -45
  137. package/skills/wix-headless/references/astro/bookings/SERVICES_PAGES.md +0 -77
  138. package/skills/wix-headless/references/astro/cms/CMS_FOUNDATIONS.md +0 -214
  139. package/skills/wix-headless/references/astro/cms/FAQ_KNOWLEDGE_BASE.md +0 -231
  140. package/skills/wix-headless/references/astro/cms/PORTFOLIO.md +0 -453
  141. package/skills/wix-headless/references/astro/cms/RESOURCE_LIBRARY.md +0 -354
  142. package/skills/wix-headless/references/astro/cms/TEAM_DIRECTORY.md +0 -299
  143. package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +0 -351
  144. package/skills/wix-headless/references/astro/ecom/CART_PAGES.md +0 -119
  145. package/skills/wix-headless/references/astro/ecom/CART_WIRING.md +0 -103
  146. package/skills/wix-headless/references/astro/ecom/COMPONENTS_CSS.md +0 -132
  147. package/skills/wix-headless/references/astro/forms/CONTACT_FORM.md +0 -463
  148. package/skills/wix-headless/references/astro/gift-cards/COMPONENTS.md +0 -119
  149. package/skills/wix-headless/references/astro/gift-cards/PAGES.md +0 -129
  150. package/skills/wix-headless/references/astro/stores/BACK_IN_STOCK.md +0 -178
  151. package/skills/wix-headless/references/astro/stores/CATEGORY_PAGES.md +0 -85
  152. package/skills/wix-headless/references/astro/stores/COMPONENTS_CSS.md +0 -129
  153. package/skills/wix-headless/references/astro/stores/HOME_AND_NAV.md +0 -229
  154. package/skills/wix-headless/references/astro/stores/PRODUCT_PAGES.md +0 -215
  155. package/skills/wix-headless/references/astro/stores/SHARED_WIRING.md +0 -165
  156. package/skills/wix-headless/references/astro/templates/Footer.astro +0 -27
  157. package/skills/wix-headless/references/astro/templates/Layout.astro +0 -132
  158. package/skills/wix-headless/references/astro/templates/Navigation.astro +0 -38
  159. package/skills/wix-headless/references/astro/templates/astro.config.mjs +0 -41
  160. package/skills/wix-headless/references/astro/templates/bookings/AvailabilityCalendar.tsx +0 -374
  161. package/skills/wix-headless/references/astro/templates/bookings/BookingForm.tsx +0 -136
  162. package/skills/wix-headless/references/astro/templates/bookings/SeoTags.astro +0 -25
  163. package/skills/wix-headless/references/astro/templates/bookings/ServiceBookingFlow.tsx +0 -71
  164. package/skills/wix-headless/references/astro/templates/bookings/ServiceCard.astro +0 -54
  165. package/skills/wix-headless/references/astro/templates/bookings/booking-confirmation.astro +0 -49
  166. package/skills/wix-headless/references/astro/templates/bookings/bookingDriver.ts +0 -245
  167. package/skills/wix-headless/references/astro/templates/bookings/components-bookings.css +0 -424
  168. package/skills/wix-headless/references/astro/templates/bookings/services/[slug].astro +0 -176
  169. package/skills/wix-headless/references/astro/templates/bookings/services/index.astro +0 -181
  170. package/skills/wix-headless/references/astro/templates/ecom/CartBadge.tsx +0 -84
  171. package/skills/wix-headless/references/astro/templates/ecom/CartView.tsx +0 -543
  172. package/skills/wix-headless/references/astro/templates/ecom/cart.astro +0 -13
  173. package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +0 -302
  174. package/skills/wix-headless/references/astro/templates/ecom/discounts.ts +0 -71
  175. package/skills/wix-headless/references/astro/templates/ecom/thank-you.astro +0 -24
  176. package/skills/wix-headless/references/astro/templates/gift-cards/GiftCardPurchase.tsx +0 -172
  177. package/skills/wix-headless/references/astro/templates/gift-cards/_home-teaser-snippet.astro +0 -42
  178. package/skills/wix-headless/references/astro/templates/gift-cards/_nav-snippet.astro +0 -11
  179. package/skills/wix-headless/references/astro/templates/gift-cards/components-gift-cards.css +0 -220
  180. package/skills/wix-headless/references/astro/templates/gift-cards/gift-cards.astro +0 -51
  181. package/skills/wix-headless/references/astro/templates/gift-cards/gift-cards.ts +0 -75
  182. package/skills/wix-headless/references/astro/templates/global.css +0 -288
  183. package/skills/wix-headless/references/astro/templates/index.astro +0 -56
  184. package/skills/wix-headless/references/astro/templates/stores/AddToCartButton.tsx +0 -77
  185. package/skills/wix-headless/references/astro/templates/stores/BackInStockForm.tsx +0 -176
  186. package/skills/wix-headless/references/astro/templates/stores/CategoryRail.astro +0 -69
  187. package/skills/wix-headless/references/astro/templates/stores/ProductCard.astro +0 -79
  188. package/skills/wix-headless/references/astro/templates/stores/ProductPurchase.tsx +0 -397
  189. package/skills/wix-headless/references/astro/templates/stores/SeoTags.astro +0 -21
  190. package/skills/wix-headless/references/astro/templates/stores/back-in-stock.ts +0 -67
  191. package/skills/wix-headless/references/astro/templates/stores/categories.ts +0 -155
  192. package/skills/wix-headless/references/astro/templates/stores/category/[slug].astro +0 -130
  193. package/skills/wix-headless/references/astro/templates/stores/components-stores.css +0 -400
  194. package/skills/wix-headless/references/astro/templates/stores/products/[slug].astro +0 -128
  195. package/skills/wix-headless/references/astro/templates/stores/products/index.astro +0 -101
  196. package/skills/wix-headless/references/blog/BLOG_CONTENT.md +0 -161
  197. package/skills/wix-headless/references/blog/INSTRUCTIONS.md +0 -32
  198. package/skills/wix-headless/references/bookings/FLOW.md +0 -246
  199. package/skills/wix-headless/references/bookings/INSTRUCTIONS.md +0 -95
  200. package/skills/wix-headless/references/bookings/SERVICES_DATA.md +0 -355
  201. package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +0 -176
  202. package/skills/wix-headless/references/cms/INSTRUCTIONS.md +0 -71
  203. package/skills/wix-headless/references/commands/known-apps.json +0 -6
  204. package/skills/wix-headless/references/custom/CONNECTION_PLAN.md +0 -142
  205. package/skills/wix-headless/references/custom/INSTRUCTIONS.md +0 -88
  206. package/skills/wix-headless/references/custom/blog/WIRING.md +0 -52
  207. package/skills/wix-headless/references/custom/bookings/WIRING.md +0 -197
  208. package/skills/wix-headless/references/custom/cms/WIRING.md +0 -97
  209. package/skills/wix-headless/references/custom/ecom/WIRING.md +0 -67
  210. package/skills/wix-headless/references/custom/forms/WIRING.md +0 -101
  211. package/skills/wix-headless/references/custom/stores/WIRING.md +0 -80
  212. package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +0 -59
  213. package/skills/wix-headless/references/forms/INSTRUCTIONS.md +0 -43
  214. package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +0 -51
  215. package/skills/wix-headless/references/images/INSTRUCTIONS.md +0 -357
  216. package/skills/wix-headless/references/seed-recipes.md +0 -49
  217. package/skills/wix-headless/references/shared/AGENTS_MD.md +0 -47
  218. package/skills/wix-headless/references/shared/AUTHENTICATION.md +0 -108
  219. package/skills/wix-headless/references/shared/BUILD_NOISE.md +0 -8
  220. package/skills/wix-headless/references/shared/DESIGN_MD.md +0 -84
  221. package/skills/wix-headless/references/shared/DOCS_SEARCH.md +0 -41
  222. package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +0 -186
  223. package/skills/wix-headless/references/shared/IMPLEMENTER.md +0 -206
  224. package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +0 -97
  225. package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +0 -143
  226. package/skills/wix-headless/references/shared/STYLING.md +0 -141
  227. package/skills/wix-headless/references/stores/INSTRUCTIONS.md +0 -126
  228. package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +0 -252
  229. package/skills/wix-headless/references/verticals/_schema.json +0 -74
  230. package/skills/wix-headless/references/verticals/_schema.md +0 -95
  231. package/skills/wix-headless/references/verticals/blog.md +0 -31
  232. package/skills/wix-headless/references/verticals/bookings.md +0 -41
  233. package/skills/wix-headless/references/verticals/cms.md +0 -30
  234. package/skills/wix-headless/references/verticals/ecom.md +0 -25
  235. package/skills/wix-headless/references/verticals/forms.md +0 -26
  236. package/skills/wix-headless/references/verticals/gift-cards.md +0 -24
  237. package/skills/wix-headless/references/verticals/stores.md +0 -33
  238. package/skills/wix-headless/scripts/check-manifest.mjs +0 -335
  239. package/skills/wix-headless/scripts/compose.mjs +0 -525
  240. package/skills/wix-headless/scripts/emit-design-tokens.mjs +0 -157
  241. package/skills/wix-headless/scripts/flatten.sh +0 -61
  242. package/skills/wix-headless/scripts/generate-images.mjs +0 -242
  243. package/skills/wix-headless/scripts/patch-decorative-slots.mjs +0 -148
  244. package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +0 -190
  245. package/skills/wix-headless/scripts/scaffold.sh +0 -139
  246. package/skills/wix-headless/scripts/seed-utilities.sh +0 -93
  247. package/skills/wix-headless/scripts/write-decorative-json.mjs +0 -62
  248. package/skills/wix-headless/shared-utilities/analytics.ts +0 -40
  249. package/skills/wix-headless/shared-utilities/ricos.ts +0 -179
  250. package/skills/wix-headless/shared-utilities/wix-image.ts +0 -72
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: "Setup Restaurant Reservations"
3
+ description: Configures Wix **Table Reservations**. Installing the app AUTO-provisions a default reservation location with a full config (approval AUTOMATIC, party size, weekly schedule, tables) — but with online reservations turned OFF. This recipe VERIFIES that location, CUSTOMIZES its config to the request, and TURNS ON online reservations (premium-gated). There is nothing to bulk-seed and no menu dependency. Specifies the *how* (calls + format); party sizes / hours come from the request.
4
+ ---
5
+ **RECIPE**: Business Recipe – Table-Reservations Setup for Wix Restaurants (Table Reservations app)
6
+
7
+ > **Standard call shape (every curl below).** The `<AUTH>` placeholder is shorthand for `Authorization: Bearer <TOKEN>` **and** `wix-site-id: <SITE_ID>`. Body-bearing requests also need `Content-Type: application/json`.
8
+
9
+ A checklist for turning on **table reservations** for a Wix site.
10
+ **Notice** that this recipe is **NOT** meant for coding purposes and is **ONLY** meant for initial reservations setup.
11
+
12
+ > **⚠️ Reservations is CONFIGURATION, not creation — there is NOTHING to bulk-seed.** Reservations themselves are created by **visitors at runtime** (the frontend flow), not at setup. And a **reservation location CANNOT be created via this API** — the docs are explicit: locations are "created and archived only through the Dashboard, or the Locations API." The Reservation Locations API only **queries / lists / updates**. So "setup" here means: verify the location the install already made, configure it, and switch online reservations on.
13
+
14
+ > **⚠️ THE INSTALL AUTO-provisions a default reservation location — this recipe VERIFIES and CONFIGURES it.** Installing the Table Reservations app auto-creates **one reservation location** (`default: true`) with its own `location` object and a **complete default configuration** — `approval.mode: "AUTOMATIC"` (manual approval already OFF), `partySize {min:1, max:6}`, `minimumReservationNotice 30 MINUTES`, `defaultTurnoverTime 90`, a 7-day `businessSchedule` (08:00–22:00), `timeSlotInterval 15`, and table management ON with default tables. **The one thing OFF is `onlineReservationsEnabled: false`** — flipping it on is STEP 3.
15
+
16
+ > **⚠️ NO menu dependency.** Reservations bind to a **location**, not a menu (unlike online ordering, which is menu-first). Do **not** copy the orders "seed the menu first" constraint — reservations can be set up with no menu at all.
17
+
18
+ > **This recipe is the *how*, not the *what*.** Party-size limits, business hours, turnover time, and reservation-notice come from the request you're fulfilling. This recipe only specifies the calls and the request format. Per the "simple seeds" default, if the request names no reservation specifics, keep the auto-provisioned config and just do STEP 1 + STEP 3.
19
+
20
+ > **API surface:** the **Reservation Locations** API on `https://www.wixapis.com/table-reservations/reservation-locations/v1/reservation-locations` (list `GET`, query `POST …/query`, get `GET …/{id}`, update `PATCH …/{id}`). The frontend visitor flow (time slots, held/reserve) is a separate concern — see `how-to-code-restaurant-reservations.md`.
21
+
22
+ > **⚠️ Field names — post-Jan-2026 migration.** Use the **new** field names: **`partySize`** (not `partiesSize`), **`approval`** (not `manualApproval`), **`tables.ids`** (not `tableIds`), **`ignoreConflicts`** (not the three old flags). The old names were removed after 2026-02-28; the install response still echoes some deprecated twins (e.g. `partiesSize` alongside `partySize`) — write the new ones.
23
+
24
+ ---
25
+
26
+ ## Article: Steps for Setting Up Wix Table Reservations
27
+ **YOU MUST** complete the steps in order (1-3) without requiring additional user input. Every step is idempotent — it verifies the auto-provisioned state and only writes when the request calls for a change.
28
+
29
+ ### STEP 1: Discover the auto-provisioned default reservation location
30
+
31
+ List reservation locations and take the default one. Keep its **`id`** and **`revision`** (the PATCH in STEP 2/3 needs both).
32
+
33
+ ```bash
34
+ curl -sS <AUTH> -X GET "https://www.wixapis.com/table-reservations/reservation-locations/v1/reservation-locations"
35
+ ```
36
+
37
+ Response (`reservationLocations[]`):
38
+
39
+ ```json
40
+ { "reservationLocations": [
41
+ { "id": "<reservationLocationId>", "revision": "1", "default": true, "archived": false,
42
+ "location": { "id": "<locationId>", "name": "Location 1", "timeZone": "America/New_York" },
43
+ "configuration": { "onlineReservations": {
44
+ "approval": { "mode": "AUTOMATIC" },
45
+ "partySize": { "min": 1, "max": 6 },
46
+ "minimumReservationNotice": { "number": 30, "unit": "MINUTES" },
47
+ "defaultTurnoverTime": 90,
48
+ "businessSchedule": { "periods": [ { "openDay": "MONDAY", "openTime": "08:00", "closeDay": "MONDAY", "closeTime": "22:00" } ] },
49
+ "onlineReservationsEnabled": false,
50
+ "timeSlotInterval": 15
51
+ } } }
52
+ ] }
53
+ ```
54
+
55
+ **⚠️ CRITICAL:**
56
+ - **Do not POST to create a location** — there is no create method in this API; use the one the install made. If `reservationLocations[]` is **empty**, the install hasn't finished provisioning — **wait briefly and retry the GET once**; do not try to create one. Still empty after one retry → **fail loud** (either the install didn't complete, or the site genuinely has no location; a location can only be added via the Dashboard / Locations API, which is out of scope here).
57
+ - Take the entry with **`default: true`** (there's normally exactly one). Keep `reservationLocation.id` and the **current** `revision`.
58
+ - **Verify `configuration.onlineReservations.approval.mode` is `"AUTOMATIC"`** — that means manual approval is OFF, which is required for a headless site to auto-confirm reservations (there's no dashboard operator to approve). It's the default; only PATCH it (STEP 2 shape) if you find it set to a manual mode.
59
+
60
+ ### STEP 2: Customize the configuration (only what the request names)
61
+
62
+ PATCH the location to set party-size limits, hours, turnover, or notice per the request. Partial updates are supported; **`revision` is mandatory**. **Config PATCH works on a non-premium site** (unlike the enable toggle in STEP 3).
63
+
64
+ ```bash
65
+ curl -sS <AUTH> -X PATCH \
66
+ "https://www.wixapis.com/table-reservations/reservation-locations/v1/reservation-locations/<reservationLocationId>" \
67
+ -d '{
68
+ "reservationLocation": {
69
+ "id": "<reservationLocationId>",
70
+ "revision": "<revision>",
71
+ "configuration": { "onlineReservations": {
72
+ "partySize": { "min": 2, "max": 10 },
73
+ "minimumReservationNotice": { "number": 60, "unit": "MINUTES" },
74
+ "defaultTurnoverTime": 90
75
+ } }
76
+ }
77
+ }'
78
+ ```
79
+
80
+ **⚠️ CRITICAL:**
81
+ - **`revision` must be the current one** (from STEP 1, or the previous PATCH's response); it increments by 1 each update — a stale revision 400s. Keep the new revision for STEP 3.
82
+ - **You cannot change the `location` object** via this method (address/name live on the business Location) — attempting to returns an application error. Only touch `configuration`.
83
+ - Use the **new** field names (`partySize`, `approval`) — see the migration callout above.
84
+ - Skip this step entirely if the request names no reservation specifics (keep the auto-provisioned config).
85
+
86
+ ### STEP 3: Turn on online reservations (premium-gated)
87
+
88
+ Flip `onlineReservationsEnabled` on so visitors can book. Send the current `revision`.
89
+
90
+ ```bash
91
+ curl -sS <AUTH> -X PATCH \
92
+ "https://www.wixapis.com/table-reservations/reservation-locations/v1/reservation-locations/<reservationLocationId>" \
93
+ -d '{
94
+ "reservationLocation": {
95
+ "id": "<reservationLocationId>",
96
+ "revision": "<revision>",
97
+ "configuration": { "onlineReservations": { "onlineReservationsEnabled": true } }
98
+ }
99
+ }'
100
+ ```
101
+
102
+ **⚠️ CRITICAL — this toggle is PREMIUM-ONLY; on a non-premium site it returns `428 PREMIUM_ONLY`, NOT success.** On a free/headless site this PATCH fails with:
103
+ ```json
104
+ { "message": "Can't turn on online reservation for a non-premium website", "details": { "applicationError": { "code": "PREMIUM_ONLY" } } }
105
+ ```
106
+ This is a **site-provisioning precondition, not a recipe bug** — treat `428 PREMIUM_ONLY` as an **expected, non-fatal** outcome: record that the site must be upgraded to premium before online reservations can be turned on (the owner then enables it, in the Dashboard or via this same call on the premium site), and **continue**. Do **not** retry-spiral it and do **not** fail the whole seed over it. (This is stricter than online ordering, where only *paid checkout* needs premium — here the *enable toggle itself* is gated.) On a premium site the same call returns the updated location with `onlineReservationsEnabled: true`.
107
+
108
+ ---
109
+
110
+ ## Conclusion
111
+ Following these steps configures Table Reservations for a site:
112
+ - Uses the **auto-provisioned default reservation location** (discovered, never created — locations come only from the Dashboard / Locations API), with its `id` + `revision` kept.
113
+ - Verifies **manual approval is off** (`approval.mode: "AUTOMATIC"`) so a headless site auto-confirms.
114
+ - **Customizes** party size / hours / turnover / notice per the request via `PATCH` (works on non-premium; `revision` mandatory; `location` object immutable here; new field names).
115
+ - **Attempts to enable online reservations** (`onlineReservationsEnabled: true`) — succeeds on premium, returns a non-fatal **`428 PREMIUM_ONLY`** on a non-premium site (recorded as a premium precondition, not a failure).
116
+ - **Nothing is bulk-seeded** and there is **no menu dependency** — reservations are created by visitors at runtime (`how-to-code-restaurant-reservations.md`).
117
+ </content>
@@ -0,0 +1,152 @@
1
+ ---
2
+ name: "Setup Restaurants"
3
+ description: Initializes a Wix Restaurants Menus backend — cleans the install's default sample menu, then bulk-creates items, bulk-creates sections (referencing item ids), and creates the menu (referencing section ids), all visible. Specifies the *how* (calls + format); the menu/section/item counts and names come from the request.
4
+ ---
5
+ **RECIPE**: Business Recipe – Initial Setup for Wix Restaurants (Menus API)
6
+
7
+ > **Standard call shape (every curl below).** The `<AUTH>` placeholder is shorthand for `Authorization: Bearer <TOKEN>` **and** `wix-site-id: <SITE_ID>`. Body-bearing requests also need `Content-Type: application/json`.
8
+
9
+ A concise checklist for preparing any new Wix site that uses the Wix Restaurants **Menus** app.
10
+ **Notice** that this recipe is **NOT** meant for coding purposes and is **ONLY** meant for initial menu setup.
11
+
12
+ > **This recipe is the *how*, not the *what*.** What to seed — how many menus, which sections, how many items per section and their names/descriptions/prices — is determined by the request you're fulfilling. This recipe only specifies the calls and the request format; it does not decide quantities or which entities to create.
13
+
14
+ > **API surfaces:** everything is the Restaurants **Menus V1** API on `https://www.wixapis.com/restaurants/menus/v1/...` (menus, sections, items — all under this one service). This is the **new** Wix Restaurants Menus API; do not mix in any older `restaurants/v1beta` or ordering/reservations endpoints. Online ordering and table reservations are **separate apps** and out of scope for menu seeding.
15
+
16
+ > **REST flattens the protobuf wrappers.** The raw method schemas show fields like `visible`, `id`, `description` as wrapper objects (`{"value": …}`). In the actual REST JSON they are **plain values** — send `"visible": true`, `"description": "text"`, and read back `"id": "<guid>"`. Never send `{"value": …}`.
17
+
18
+ ---
19
+
20
+ ## Article: Steps for Setting Up Wix Restaurants Menus
21
+ **YOU MUST** complete all the following steps **in the given order** (0-3) without skipping any and **without requiring additional user input**. The **Attach images** step runs last, only when `imagery` is on.
22
+
23
+ **⚠️ CRITICAL ORDER REQUIREMENT: build the hierarchy BOTTOM-UP — items (STEP 1) → sections (STEP 2) → menu (STEP 3).** A section is created with the **`itemIds`** of the items it contains, and a menu is created with the **`sectionIds`** of the sections it contains. So the child ids must exist before you create the parent. Do the cleanup (STEP 0) first of all, so the ids you delete are provably the install's samples.
24
+
25
+ ### STEP 0: Clean the install — remove the default sample menu
26
+
27
+ **A freshly installed Wix Restaurants Menus app ships a fully populated default "Dinner Menu"** (roughly one menu, ~4 sections, ~21 items). Remove it **before** creating yours, so the storefront shows only your menu. Do this **first** — cleaning before you create guarantees the ids you delete are the install's samples, never your own entities. Delete children before parents (items → sections → menus):
28
+
29
+ 1. **Bulk-delete items** — `GET https://www.wixapis.com/restaurants/menus/v1/items` (collect every `items[].id`), then `DELETE https://www.wixapis.com/restaurants/menus/v1/bulk/items/delete` with body `{"ids": ["<id>", …]}`.
30
+ 2. **Bulk-delete sections** — `GET https://www.wixapis.com/restaurants/menus/v1/sections` (collect every `sections[].id`), then `DELETE https://www.wixapis.com/restaurants/menus/v1/bulk/sections/delete` with body `{"ids": ["<id>", …]}`.
31
+ 3. **Delete menus** — `GET https://www.wixapis.com/restaurants/menus/v1/menus` (collect every `menus[].id`), then delete each one with `DELETE https://www.wixapis.com/restaurants/menus/v1/menus/{menuId}` (**no bulk-delete endpoint for menus** — one DELETE per menu; there is normally just the single default menu). Single delete takes only the path id — **no `revision` needed**.
32
+
33
+ The bulk-delete responses carry per-id `results[].itemMetadata.success`; a menu delete returns `200 {}`. If the lists come back empty, this is a safe no-op — continue.
34
+
35
+ ### STEP 1: Bulk-create the items
36
+
37
+ Create all items in a **single bulk request** to `POST https://www.wixapis.com/restaurants/menus/v1/bulk/items/create`. **How many items, and their names/descriptions/prices, come from the request you're fulfilling — this step only gives the call and the required format.**
38
+
39
+ **Request body shape** (one representative item shown — repeat item objects inside the `items` array):
40
+
41
+ ```json
42
+ {
43
+ "items": [
44
+ {
45
+ "name": "Bruschetta al Pomodoro",
46
+ "description": "Grilled sourdough, San Marzano tomatoes, basil.",
47
+ "priceInfo": { "price": "9.50" },
48
+ "visible": true
49
+ }
50
+ ],
51
+ "returnEntity": true
52
+ }
53
+ ```
54
+
55
+ **⚠️ CRITICAL FORMAT REQUIREMENTS:**
56
+ - **Price goes in `priceInfo.price` as a decimal STRING** (`"9.50"`, not the number `9.50`). The currency is **derived from the site** — do **not** send a currency; the response echoes a `priceInfo.formattedPrice` (e.g. `"$9.50"`) in the site's currency.
57
+ - **Do NOT use the top-level `price` field** — it is deprecated (superseded by `priceInfo`). Use `priceInfo.price`.
58
+ - **`description` is a plain string** (not rich-text nodes). Omit it for a name-only item.
59
+ - **Set `"visible": true` explicitly** on every item (see the visibility callout below).
60
+ - **Imagery is opt-in** (`SEED.md` § "Entity images"). Seed **text-only by default** — omit `image`. When `imagery` is on, the **Attach images** step below writes an `image` onto each item in a second pass.
61
+ - If part of the bulk request fails, retry the failed items **once** with the exact same format; do not loop.
62
+
63
+ **⚠️ Reading the response — created items are under `results[].item`, and `results[].itemMetadata.success` is the per-item flag.** A successful bulk create returns `200`:
64
+
65
+ ```json
66
+ { "results": [
67
+ { "itemMetadata": { "id": "<itemId>", "originalIndex": 0, "success": true },
68
+ "item": { "id": "<itemId>", "name": "Bruschetta al Pomodoro", "priceInfo": { "price": "9.50", "formattedPrice": "$9.50" }, "visible": true } }
69
+ ], "bulkActionMetadata": { "totalSuccesses": 1, "totalFailures": 0 } }
70
+ ```
71
+
72
+ Keep each item's **`id`** (from `results[].item.id`), grouped by the section it belongs to — STEP 2 wires items into sections via these ids.
73
+
74
+ ### STEP 2: Bulk-create the sections (referencing their item ids)
75
+
76
+ Create all sections in a **single bulk request** to `POST https://www.wixapis.com/restaurants/menus/v1/bulk/sections/create`. Each section carries the **`itemIds`** array of the items (from STEP 1) that belong to it. **Which sections, and which items go in each, come from the request you're fulfilling.**
77
+
78
+ **Request body shape** (repeat section objects inside the `sections` array):
79
+
80
+ ```json
81
+ {
82
+ "sections": [
83
+ {
84
+ "name": "Antipasti",
85
+ "description": "To start",
86
+ "visible": true,
87
+ "itemIds": ["<itemId1>", "<itemId2>"]
88
+ }
89
+ ],
90
+ "returnEntity": true
91
+ }
92
+ ```
93
+
94
+ **⚠️ CRITICAL:**
95
+ - **`itemIds` must be real item ids from STEP 1**, in the display order you want. An item can appear in more than one section, but normally each item belongs to exactly one.
96
+ - **Set `"visible": true` explicitly.**
97
+ - Read created sections from **`results[].item`** (the bulk envelope reuses the generic `item` key even for sections). Keep each section's **`id`** — STEP 3 wires sections into the menu via these ids.
98
+ - Retry failed sections **once**; do not loop.
99
+
100
+ ### STEP 3: Create the menu (referencing its section ids)
101
+
102
+ Create the menu with `POST https://www.wixapis.com/restaurants/menus/v1/menus`. The menu carries the **`sectionIds`** array of the sections (from STEP 2) it contains. There is normally **one** menu; if the request calls for several, use the bulk endpoint `POST https://www.wixapis.com/restaurants/menus/v1/bulk/menus/create` with a `{"menus": [ … ], "returnEntity": true}` body (same envelope as items/sections).
103
+
104
+ **Request body shape** — the single-create wraps the menu in a **`menu`** object:
105
+
106
+ ```json
107
+ {
108
+ "menu": {
109
+ "name": "Dinner",
110
+ "description": "Evening menu",
111
+ "visible": true,
112
+ "sectionIds": ["<sectionId1>", "<sectionId2>"]
113
+ }
114
+ }
115
+ ```
116
+
117
+ **⚠️ CRITICAL:**
118
+ - **`sectionIds` must be real section ids from STEP 2**, in display order.
119
+ - **Set `"visible": true` explicitly.**
120
+ - The single-create response is `{"menu": { "id": "<menuId>", "sectionIds": [ … ], "visible": true, "urlQueryParam": "dinner" }}` — read the **`menu.id`** (bulk create returns `results[].item` like the others). Keep the `menuId`.
121
+ - **`businessLocationId` is optional** — omit it and the menu/section bind to the site's default (main) business location. Only set it for a multi-location restaurant when the request names locations.
122
+
123
+ **⚠️ VISIBILITY — set `"visible": true` explicitly at every level (item, section, menu).** Storefront menu queries return only visible entities to visitors. Always include `visible: true` on every item, every section, and the menu, rather than relying on a default — an entity created without it may exist but not render on the live site.
124
+
125
+ ### Attach images (imagery ON only — skip otherwise)
126
+
127
+ **Only when `imagery` is on** (`SEED.md` § "Entity images"). Items were created text-only in STEP 1; this pass-2 step writes a generated dish image onto each. The **item** is the image-bearing entity (sections and the menu render from their items) — attach per item. Generate + import per `references/IMAGE_GENERATION.md` → keep `file.url` and its `file.id`, then PATCH the item.
128
+
129
+ **⚠️ On write, `image` is an OBJECT `{ id, url, height, width }`** (per the Create/Update Item docs) — even though the storefront SDK surfaces `item.image` as a bare *string* on **read** (`how-to-code-restaurants.md` § "Rendering images"; at the REST layer the read is an object too). Do **not** write a plain string. The binding field is the image **`id`** (the Wix Media file id); `url` + dimensions are descriptive.
130
+
131
+ **⚠️ CRITICAL: Update Item is a FULL-ENTITY REPLACE with NO field mask — you MUST echo the item's existing `priceInfo` (and `priceVariants`, if the item is variant-priced) in the PATCH body, alongside `image`.** A body of just `{ id, revision, image }` drops the price and fails **`428 MISSING_ITEM_PRICING`** (`"Item must have either price or price variants"`) — the write does **not** apply. So first **`GET https://www.wixapis.com/restaurants/menus/v1/items/{itemId}`** for the item's current **`revision` + `priceInfo`** (or reuse the `item.revision` + `item.priceInfo` from STEP 1's `returnEntity` response), and echo both back:
132
+
133
+ ```bash
134
+ curl -X PATCH 'https://www.wixapis.com/restaurants/menus/v1/items/<itemId>' \
135
+ -H 'Authorization: <AUTH>' \
136
+ -H 'Content-Type: application/json' \
137
+ -d '{ "item": { "id": "<itemId>", "revision": "<current revision>", "priceInfo": { "price": "<current price>" }, "image": { "id": "<file.id>", "url": "<file.url>", "height": 1024, "width": 1024 } } }'
138
+ ```
139
+
140
+ - **Bulk variant** — to image many items at once, `POST https://www.wixapis.com/restaurants/menus/v1/bulk/items/update` with `{"items": [ { "item": { "id", "revision", "priceInfo", "image": {…} } }, … ]}` (each item still needs its own `revision` **and** its `priceInfo` — the full-replace rule applies per item).
141
+ - A **stale or omitted `revision`** fails the update — fetch/echo the current one.
142
+ - **Never block on image failure** (`SEED.md` § "Entity images" / IMAGE_GENERATION "Credits, cost & the not-generating fallback") — on failure, skip and leave the item text-only.
143
+
144
+ ---
145
+
146
+ ## Conclusion
147
+ Following these steps **in order** sets up a new Wix Restaurants Menus site:
148
+ - Starts from a **clean menu** — the install's default sample "Dinner Menu", its sections, and its items are all removed first.
149
+ - Contains the menu, sections, and items called for by the request, built **bottom-up** (items → sections → menu) so every parent references real child ids.
150
+ - Every item, section, and menu is created **`visible: true`** so it appears on the live site.
151
+ - Prices are decimal strings under `priceInfo.price`; currency is the site's own. All calls use the Restaurants **Menus V1** API.
152
+ - Items are seeded **text-only**; when `imagery` is on, the **Attach images** step writes an `image` **object** (`{ id, url, height, width }`) onto each — never a bare string. Update Item is a full replace with no field mask, so the PATCH echoes the item's existing `revision` **and** `priceInfo` alongside `image` (a body missing `priceInfo` fails `428 MISSING_ITEM_PRICING`).
@@ -0,0 +1,57 @@
1
+ # Authentication — managed (Wix CLI)
2
+
3
+ For a **managed** project (hosted on Wix infrastructure), every Wix call uses a token minted by the **Wix CLI** — `@wix/cli` + `curl`, no MCP, no SDK. This file is the authority for how `managed` obtains `$TOKEN`, `$SITE_ID`, and the public `clientId`; the flow files (`SETUP.md`, `SEED.md`, `SDK_HANDOFF.md`) defer here.
4
+
5
+ ## 1 · Ensure an authenticated CLI session
6
+
7
+ ```bash
8
+ npx @wix/cli@latest whoami # exits 0 when logged in; non-zero when logged out
9
+ ```
10
+
11
+ If it's non-zero, **log in yourself** — don't punt to the user and stop:
12
+
13
+ 1. Run `npx @wix/cli@latest login` with **`run_in_background: true`** (no shell `&`, no redirect of your own — the harness captures stdout to its task-output file and returns the path).
14
+ 2. Poll that file for the first JSON event: `{"event":"awaiting_user","userCode":"…","verificationUri":"…"}`.
15
+ 3. Surface it to the user in plain prose: *"Open `<verificationUri>` and enter the code `<userCode>` — I'll continue once you've logged in."* **Send the message; do not re-invoke login.**
16
+ 4. Wait for the harness `task-notification` with `<status>completed</status>` (not a sleep loop). On exit 0, run `whoami` once to confirm, then proceed.
17
+
18
+ ## 2 · Mint the token
19
+
20
+ ```bash
21
+ SITE_ID="<siteId>" # from wix.config.json
22
+ TOKEN=$(npx @wix/cli@latest token --site "$SITE_ID")
23
+ ```
24
+
25
+ - Mints a **site-scoped REST token**. **Mint once per run and never re-mint** — the CLI returns a **byte-identical** token on every call within a run (it caches internally), so re-minting only costs ~1.25 s of startup. Cache `$TOKEN` and `$SITE_ID` in scratch.
26
+ - Use `npx @wix/cli@latest token …` (not bare `wix token`) so `npx` resolves the project-local CLI.
27
+ - The first `--site "$SITE_ID"` call is the source of truth for `SITE_ID`; bind it in scratch, don't re-derive mid-run.
28
+
29
+ ## 3 · `clientId` for the frontend
30
+
31
+ The frontend's public `clientId` **is the `appId` field in `wix.config.json`** — for a managed headless project the OAuth **app id and the client id are the same value** (app-id === client-id). It's the same file you already read for `siteId` (§2), so **read `appId` straight from there** — do **not** query the OAuth-apps API, search the docs, or mint anything to obtain it. (It's the public OAuth id, not a secret.)
32
+
33
+ ## REST call shape
34
+
35
+ ```bash
36
+ curl -sS -w "\nHTTP_STATUS:%{http_code}" \
37
+ -X POST "https://www.wixapis.com/<endpoint>" \
38
+ -H "Authorization: Bearer $TOKEN" \
39
+ -H "wix-site-id: $SITE_ID" \
40
+ -H "Content-Type: application/json" \
41
+ -d '<body>'
42
+ ```
43
+
44
+ - **`Authorization: Bearer $TOKEN`** — the `Bearer` prefix is required.
45
+ - **`wix-site-id: $SITE_ID`** — required by every site-scoped family; include it always.
46
+ - **`Content-Type: application/json`** — on every POST/PATCH body.
47
+ - **Parsing the response:** `-w` appends a `HTTP_STATUS:<code>` line *after* the JSON body. `grep` that line for the status, but parse the **body separately** — piping the combined output to a JSON parser (`python3 -m json.tool`, `json.load`, `jq`) chokes on the trailing status line (`Extra data: line 2 …`). Capture the body to a file with `-o body.json` (status still comes from `-w`), or drop the last line, before parsing.
48
+
49
+ ## Recovery ladder
50
+
51
+ Re-mint is **not** a recovery step (the token is byte-identical) — retry the *same* call with the cached token.
52
+
53
+ | Symptom | First response | If it still fails |
54
+ |---|---|---|
55
+ | `401 Unauthorized` | Retry once with the cached token. | CLI session expired — run `npx @wix/cli@latest login` (a new session), then re-mint. |
56
+ | `403 Forbidden` | Retry once with the cached token. | App not installed yet (re-check the apps-installer returned 200), or the caller lacks permission — surface the response; don't loop. |
57
+ | `404` on a documented URL | Re-read the recipe — a path typo. | Recipe bug; surface and stop. |
@@ -0,0 +1,74 @@
1
+ # Connect — wire an existing project to a managed Wix backend
2
+
3
+ **Managed only.** This flow runs when the project type is `managed` and the operation is
4
+ `connect` **or** `iterate` — a frontend project is already on disk (or a design URL was fetched into
5
+ CWD) and the user wants it hosted on Wix and powered by Wix Business Solutions. It attaches Wix to the
6
+ project (or reuses the existing connection when iterating), runs the shared backend flow, wires the UI
7
+ to that backend, builds, and releases. **The only difference for `iterate`** — the project is already
8
+ connected, so §1 skips `init` and reuses the existing `wix.config.json`.
9
+ **No Designer, no templates, no binding-map machinery** — `SDK_HANDOFF.md` is the wiring reference.
10
+
11
+ Run these in order:
12
+
13
+ ## 1 · Attach Wix to the project — skip if already connected
14
+
15
+ **If a `wix.config.json` (or `.wix/`) is already present, the project is already connected to Wix — this is the *iterate* case.** Do **not** run `init` again (it's for attaching a *new* Wix project). Read `./wix.config.json` → hold `SITE_ID` in scratch, and skip to §2.
16
+
17
+ > **Iterate is incremental.** An already-connected project may already be set up and/or seeded from a prior run. In §3–§4, **check current state before acting** — query installed apps before installing, check for already-seeded content before seeding (re-seeding duplicates it), and inspect existing wiring before adding. Do only the delta the new intent requires; leave the rest untouched.
18
+
19
+ Otherwise, attach Wix in place:
20
+
21
+ ```bash
22
+ CI=1 npm create @wix/new@latest init
23
+ ```
24
+
25
+ Run from the project directory. It creates `wix.config.json` (with the `siteId` and the headless
26
+ OAuth app) and registers the project's origin on that app. Read `./wix.config.json` → hold `SITE_ID`
27
+ in scratch.
28
+
29
+ **If the design was brought in from elsewhere** (a `.zip`/folder/file, or a fetched design-file URL),
30
+ place it into CWD **first** — unzip/copy/fetch the design's files into the working directory so it's the
31
+ project on disk — **then** `init`. An empty CWD plus a brought-in design is still `connect`, not create:
32
+ land the design, then attach Wix to it.
33
+
34
+ ## 2 · Authenticate
35
+
36
+ Per `references/managed/AUTHENTICATION.md` — `whoami`/login if needed, then mint the site token
37
+ (`$TOKEN`) for `$SITE_ID`.
38
+
39
+ ## 3 · Backend flow (shared)
40
+
41
+ - **`references/SETUP.md`** — install the apps the resolved `verticals[]` need.
42
+ - **`references/SEED.md`** — create the backend content (and, if `imagery` is on, attach entity images).
43
+
44
+ ## 4 · Wire the existing UI
45
+
46
+ **Read the frontend reference for *how to connect* first**, keyed on the brought project's framework:
47
+ an **Astro** project → **`references/astro.md`** (auto-auth, no client); **any other framework or a
48
+ static design** → **`references/non-astro.md`** (manual `OAuthStrategy` client). The chosen file carries
49
+ the connect mechanics and the framework caveats; **`references/SDK_HANDOFF.md`** carries the
50
+ per-capability packages, the SDK docs, and the seeded schema (all other content is queried live).
51
+
52
+ Connect the existing project to the live backend. Install the SDK packages the loaded verticals need;
53
+ then, with **additive** edits:
54
+ - bind seeded content into the regions that already exist (product grids, post lists, item pages…);
55
+ - add the connected feature the intent implies where it's missing (e.g. a contact/RSVP form, a cart);
56
+ - always guard SDK calls (try/catch + fallback) so a failed call never blanks the page.
57
+
58
+ A run must end with the site actually reading from / writing to Wix — `init` + `release` with nothing
59
+ wired is not an acceptable outcome. If `imagery` is on and a surface needs an image, generate it per
60
+ **`references/IMAGE_GENERATION.md`** (up to the per-run `imageCap`, Discovery §4); for any slot not
61
+ generated — off, over the cap, or a failure — render the **themed-block fallback** (a styled `div` on
62
+ the design tokens), never an empty or broken slot.
63
+
64
+ ## 5 · Build & release
65
+
66
+ **Release once, at the very end** — only after Setup (§3), Seed **including the entity-image attach** (`SEED.md` § "Entity images"), the UI wiring (§4), and any imagery are all complete. Don't `build && release` mid-flow to preview. **A re-release does not refresh backend content:** a headless frontend fetches seeded content and entity images at **runtime**, so they're not in the build output — changing a seeded entity or attaching an image after release is live on the next request with **no** re-publish. Re-release only when the **frontend build output** changed. A backend image that isn't showing is an attach-shape bug (`SEED.md` § "Entity images"), not a stale cache — don't re-release to clear one.
67
+
68
+ If the project has its own build (`package.json` with a `build` script), run `npm run build` and point
69
+ `wix.config.json`'s `site.outputDirectory` at the build output. A **static** site (no build) needs the
70
+ static-hosting fixes in **`references/managed/DEPLOYMENT.md`** — the entry file must be named
71
+ `index.html`, and `outputDirectory` must point at the directory holding it (init's `./dist` default is
72
+ wrong for static). Then finalize per **`references/managed/DEPLOYMENT.md`** (`npx @wix/cli@latest release` — Wix
73
+ publishes + registers the origin OOTB). Close with a short summary (apps installed, content seeded, what
74
+ was wired, live URL).
@@ -0,0 +1,130 @@
1
+ # Create — scaffold a new managed Wix Headless project
2
+
3
+ **Managed only.** This flow runs when the project type is `managed` and the operation is
4
+ `create` (an empty directory + a "build me a site" intent). It scaffolds a fresh Wix Headless
5
+ project, runs the shared backend flow against it, builds the frontend wired to that backend, and
6
+ releases. There is **no Designer and no template library** — the frontend is built ad-hoc to the
7
+ user's intent, using `SDK_HANDOFF.md` as the integration reference.
8
+
9
+ Run these in order:
10
+
11
+ ## 0 · Resolve the frontend framework
12
+
13
+ Default is **Astro** — the documented managed default. Set `frontendFramework` to a non-Astro
14
+ framework **only if the user names one**: "Vite", "React", "Vue", "Svelte", "Next", "plain HTML/static",
15
+ or any "not Astro / don't use Astro" phrasing. Never infer a framework the user didn't name
16
+ (`references/non-astro.md` Caveat N1). Hold `frontendFramework` in scratch — it selects the **scaffold
17
+ command (§1)**, the **wiring reference (§4)**, and the **build command (§5)**. Derive `<folder-name>` as
18
+ a lowercase, npm-safe name from the brand (lowercase letters, numbers, hyphens; starts with a letter or
19
+ number).
20
+
21
+ ## 1 · Scaffold the project
22
+
23
+ Branch on `frontendFramework` from §0. **Both** branches end with a `wix.config.json` (the Wix link:
24
+ `siteId` + private-app `appId`) in the project root — read it → hold `SITE_ID` (the `siteId`) in scratch.
25
+
26
+ ### Astro (default)
27
+
28
+ Run the **documented** create command (flags and rationale: `references/astro.md` §1):
29
+
30
+ ```bash
31
+ CI=1 npm create @wix/new@latest -- headless \
32
+ --folder-name <folder-name> \
33
+ --business-name "<Brand Name>" \
34
+ --site-template \
35
+ --skip-install \
36
+ --no-publish
37
+ ```
38
+
39
+ - The `--` separator is required. Bare `--site-template` (no value) keeps it on the **blank** starter —
40
+ the model owns design, so don't adopt a business template; a value, or omitting the flag, would
41
+ prompt and abort in a non-interactive shell.
42
+ - The command provisions the Wix site + private app and writes `wix.config.json`. It requires a
43
+ logged-in CLI session (step 2 handles login if needed).
44
+ - It creates the project in a **subdirectory named `<folder-name>`** — there is no in-place option, so
45
+ **`cd <folder-name>`** and run the rest of the flow from inside it (it's the project root, with the
46
+ single `.wix/`).
47
+ - `--skip-install` defers dependency install to step 4 (which adds the SDK package set); run
48
+ `npm install` there before building.
49
+
50
+ ### Non-Astro (a framework was named)
51
+
52
+ There is **no Wix scaffolder for a non-Astro site** (`non-astro.md` N1) — so scaffold the framework's
53
+ **own** project first, then `init` it onto Wix (two steps, in this order):
54
+
55
+ ```bash
56
+ # 1. the framework's OWN documented scaffolder — e.g. Vite + React:
57
+ npm create vite@latest <folder-name> -- --template react
58
+ cd <folder-name>
59
+ # 2. connect this folder to a fresh Wix headless project, IN PLACE:
60
+ CI=1 npm create @wix/new@latest init
61
+ ```
62
+
63
+ - Use the framework's documented create command (read its docs if unsure of the template flag) — Vite,
64
+ Next, SvelteKit, Vue, etc. For **plain static HTML** there's no scaffolder: create the folder and an
65
+ `index.html` yourself, then run `init`.
66
+ - `npm create @wix/new@latest init` runs **in place** (no new subdirectory, no Astro files added): it
67
+ signs you in, provisions the Wix site + private app, and writes `wix.config.json`
68
+ (`siteId`, `appId`, `site.outputDirectory: "./dist"`). It takes no flags. Run it **from inside**
69
+ `<folder-name>` *after* the framework scaffold exists.
70
+ - A static (no-build) frontend builds to no `dist` — fix `site.outputDirectory` per
71
+ `managed/DEPLOYMENT.md` ("Static frontends") before release.
72
+
73
+ ## 2 · Authenticate
74
+
75
+ Per `references/managed/AUTHENTICATION.md` — `whoami`/login if needed, then mint the site token
76
+ (`$TOKEN`) for `$SITE_ID`. (Scaffold already required a logged-in CLI session.)
77
+
78
+ ## 3 · Backend flow (shared)
79
+
80
+ Run the agnostic flow against the scaffolded site:
81
+ - **`references/SETUP.md`** — install the apps the resolved `verticals[]` need.
82
+ - **`references/SEED.md`** — create the backend content (and, if `imagery` is on, attach entity images).
83
+
84
+ ## 4 · Build the frontend (wired to the backend)
85
+
86
+ **Read the frontend reference for *how to connect* first — pick it by `frontendFramework` (§0):**
87
+
88
+ - **Astro** (default) → **`references/astro.md`**: managed-Astro auto-authenticates, so the frontend
89
+ creates **no client** (no `OAuthStrategy`, no `clientId`) — you `import { x } from "@wix/<pkg>"` and
90
+ call methods. astro.md also carries the load-bearing caveats (the always-on `astro.config.mjs`
91
+ integrations, SSR error guards, island hydration).
92
+ - **Non-Astro** → **`references/non-astro.md`**: the manual `OAuthStrategy` visitor-client path
93
+ (`createClient({ modules, auth: OAuthStrategy({ clientId }) })`), where `clientId` is the public
94
+ `appId` from the `wix.config.json` written by `init` (§1).
95
+
96
+ Then build the pages the user's intent calls for, **wired to the live backend**, using
97
+ **`references/SDK_HANDOFF.md`** for the per-capability packages, the SDK docs, and the seeded schema to
98
+ bind (collection/form names + field keys; all other content is queried live). Install the SDK packages the loaded verticals need, author the pages/components directly in the
99
+ project, and bind them to the live backend content. Keep it scoped to what was asked — no speculative pages.
100
+
101
+ > **`npm install` note (Astro):** always run **`npm install --ignore-scripts`**. Astro pulls `sharp`
102
+ > as an *optional* transitive dep for **local, build-time**
103
+ > image optimization this headless flow never uses (all imagery is remote Wix Media URLs served through
104
+ > plain `<img>`), and its from-source native build can fail and abort the whole install; `--ignore-scripts`
105
+ > skips that failing build up front. **Do not** use the deprecated `--no-optional` (silent no-op in modern
106
+ > npm — sharp still builds) or `--omit=optional` (sharp still resolves). A failed/absent `sharp` is
107
+ > **expected and harmless — never build, retry, or repair it, and never spend time diagnosing it**
108
+ > (`astro.md` Caveat A9).
109
+
110
+ If `imagery` is on and a surface needs an image (e.g. a homepage hero, an about-section visual),
111
+ generate it per **`references/IMAGE_GENERATION.md`** and use its `file.url` — up to the per-run
112
+ `imageCap` (Discovery §4). Generate only what the pages actually use. For any slot **not** generated
113
+ (imagery off, over the cap, or a generation failure), render the **themed-block fallback** — a styled
114
+ `div` on the site's design tokens — never an empty slot or a broken `<img>` (`IMAGE_GENERATION.md`).
115
+
116
+ ## 5 · Build & release
117
+
118
+ **Release once, at the very end.** Do **not** `build && release` mid-flow to "preview" progress. Reach this step only after **all** of the earlier work is done: Setup (§3), Seed **including the entity-image attach** (`SEED.md` § "Entity images" — pass-2 patches), the frontend wiring (§4), and any page imagery. A single release at the end is the target; each extra build+release cycle is wasted wall time.
119
+
120
+ **A re-release does not refresh backend content — don't reach for one to "fix" seeded data or images.** A headless frontend fetches seeded backend content **and entity images at runtime** (via the SDK / REST), so that content is *not* baked into the build output. If you change a seeded entity or attach an image **after** releasing, the live site already reflects it on the next request — there is nothing to re-publish. Re-release **only** when the **frontend build output itself** changed. In particular, a backend image that isn't showing is an **attach-shape bug** (wrong write shape → the entity has no image — see `SEED.md` § "Entity images" / the capability recipe's **Attach images** step), **not** a stale CDN cache; don't re-release to "clear a cache" for it.
121
+
122
+ Produce the build output, then finalize per **`references/managed/DEPLOYMENT.md`**
123
+ (`npx @wix/cli@latest release` — Wix publishes the site and registers the origin OOTB). The build step
124
+ depends on `frontendFramework` (§0):
125
+
126
+ - **Astro** → `npx @wix/cli@latest build`.
127
+ - **Non-Astro** → the framework's own build (e.g. `npm run build`); a static (no-build) site skips this.
128
+ `release` publishes whatever `site.outputDirectory` points at (default `./dist`).
129
+
130
+ Close with a short summary (apps installed, content seeded, pages built, live URL).
@@ -0,0 +1,57 @@
1
+ # Deployment — managed (Wix CLI release)
2
+
3
+ For a **managed** project, Wix owns the hosting, so finalizing the live site is a single command — Wix handles publishing the site **and** registering the deployed origin on the OAuth app **out of the box**. There are no manual publish or origin-registration calls (unlike the self-hosted types).
4
+
5
+ ## Release
6
+
7
+ From the project directory:
8
+
9
+ ```bash
10
+ CI=1 npx @wix/cli@latest release
11
+ ```
12
+
13
+ - Publishes whatever the managed project is configured to deploy to Wix's hosting/CDN, and brings the live site up.
14
+ - The deployed origin is registered on the OAuth app automatically — the frontend's visitor SDK calls are accepted from the live URL with no extra step.
15
+ - The published URL is printed on stdout (`Site published on <url>`).
16
+
17
+ ## Member login on a **non-Astro** frontend — register the callback URI (post-release)
18
+
19
+ **Only when the run has member login on a non-Astro SPA/static frontend using the Wix login page** (`inline-recipes/how-to-code-members-non-astro.md` — the `getAuthUrl` → `/callback` handshake). Astro's built-in `/api/auth/*` callback shapes are auto-registered; a **non-Astro SPA's own callback path is not** — and **login stays dead (4xx on the login redirect) until you register it**. This is a genuine gap `wix release` does *not* close for you.
20
+
21
+ - `release` auto-registers the deployed **origin** (`allowedRedirectDomains`) — that's the visitor-SDK/CORS surface (above). It does **not** register the member-login **callback URL** (`allowedRedirectUris`). These are two different fields; members needs **both**, and only the first is automatic.
22
+ - **This is a post-release step** — the callback URL embeds the deployed origin, which is unknown until `release` prints it. Do it right after release, once the URL is known.
23
+ - **⚠️ `allowedRedirectUris` IS writable via the API — do not conclude it's read-only/dashboard-only.** The `UpdateOAuthApp` reference may not list it among the obvious updatable fields, but a masked `PATCH` sets it. The trap is a **required field mask**: without `mask.paths` the `PATCH` returns `200` and **silently no-ops**.
24
+
25
+ ```bash
26
+ ID="<clientId>" # the OAuth app id == the public clientId
27
+ # 1) GET first and append — the PATCH REPLACES the array, so include what's already there:
28
+ curl -sS -w "\nHTTP_STATUS:%{http_code}" https://www.wixapis.com/oauth-app/v1/oauth-apps/$ID \
29
+ -H "Authorization: Bearer $TOKEN"
30
+ # 2) PATCH with the field mask (register BOTH the exact callback and the versioned-preview wildcard):
31
+ curl -sS -X PATCH https://www.wixapis.com/oauth-app/v1/oauth-apps/$ID \
32
+ -H "Authorization: Bearer $TOKEN" -H 'content-type: application/json' \
33
+ -w "\nHTTP_STATUS:%{http_code}" -d '{
34
+ "oAuthApp": { "id": "'"$ID"'",
35
+ "allowedRedirectUris": [ <existing…>, "https://<host>/callback", "https://*-<host>/callback" ] },
36
+ "mask": { "paths": ["allowedRedirectUris"] }
37
+ }'
38
+ ```
39
+
40
+ - Include **both** the exact URL **and** the `https://*-<host>/…` wildcard — Wix serves versioned preview subdomains. The callback path must match the recipe's `redirectUri` **exactly** (e.g. `window.location.origin + '/callback'`).
41
+ - `allowedRedirectDomains` and `allowedRedirectUris` can go in **one** `PATCH` (list both under `mask.paths`) if you ever need to set the origin by hand too.
42
+ - **If you're not the one deploying**, you can't know the domain — flag the member-login callback URI to the user to register, and note **login is dead until they do** (higher-stakes than the origin flag).
43
+
44
+ > **Custom-login** (`how-to-code-members-custom-login.md`) does **not** need this — `register`/`login` are direct API calls with no login-page redirect. Only `sendPasswordResetEmail`'s `redirectUri` and logout's return URL need allow-listing there.
45
+
46
+ ## Static frontends (no build step)
47
+
48
+ These two fixes are **Wix-hosting facts** — they apply to a connected **static** site (plain HTML, no bundler) on the managed path, and the docs are silent on both. A bundler SPA that builds to its own output directory doesn't need them.
49
+
50
+ - **The entry file must be named `index.html`.** Wix serves `index.html` at the site root. A brought-in design named anything else (e.g. `"My Design.html"`) **publishes "successfully" but 500s/404s at runtime**. Rename the entry to `index.html` **before** release and fix internal references to it.
51
+ - **`site.outputDirectory` must point at the directory holding `index.html`.** `init` writes `site.outputDirectory: "./dist"`, which assumes an SPA that *builds* to `dist`. A static site has no build, so `./dist` is wrong — set `outputDirectory` in `wix.config.json` to the directory that actually contains `index.html`, or `release` publishes but the live site 404s at root.
52
+
53
+ ## Transient errors
54
+
55
+ A release can hit transient infrastructure errors (`ECONNRESET`, `ETIMEDOUT`, `STATE_MISMATCH`, "try again shortly"). Retry the release serially up to **3×** with a short backoff. **Build failures are not retryable** — they're code bugs; fix the code, not the retry.
56
+
57
+ That's the whole of finalize for `managed` — no `site-publisher` call, and no `oauth-app` **origin** PATCH (the origin is auto-registered). The **one** exception is the member-login callback on a non-Astro frontend above — that `allowedRedirectUris` PATCH is manual and required.