@wix/agent-skills 1.14.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.
- package/README.md +4 -1
- package/package.json +1 -1
- package/skills/README.md +23 -0
- package/skills/wix-app/SKILL.md +10 -2
- package/skills/wix-app/references/AUTO_PATTERNS_DASHBOARD.md +326 -0
- package/skills/wix-app/references/CODE_QUALITY.md +1 -0
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +124 -115
- package/skills/wix-app/references/DASHBOARD_PAGE.md +3 -0
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +23 -9
- package/skills/wix-app/references/SITE_PLUGIN.md +1 -1
- package/skills/wix-app/references/auto-patterns-dashboard/action-cell.md +115 -0
- package/skills/wix-app/references/auto-patterns-dashboard/app-config-structure.md +264 -0
- package/skills/wix-app/references/auto-patterns-dashboard/app-context.md +37 -0
- package/skills/wix-app/references/auto-patterns-dashboard/bulk-actions.md +86 -0
- package/skills/wix-app/references/auto-patterns-dashboard/collection-page-actions.md +119 -0
- package/skills/wix-app/references/auto-patterns-dashboard/collection-page.md +103 -0
- package/skills/wix-app/references/auto-patterns-dashboard/custom-actions-override.md +76 -0
- package/skills/wix-app/references/auto-patterns-dashboard/custom-columns-override.md +82 -0
- package/skills/wix-app/references/auto-patterns-dashboard/custom-components-override.md +89 -0
- package/skills/wix-app/references/auto-patterns-dashboard/custom-header-override.md +124 -0
- package/skills/wix-app/references/auto-patterns-dashboard/custom-sections-override.md +91 -0
- package/skills/wix-app/references/auto-patterns-dashboard/custom-slots-override.md +71 -0
- package/skills/wix-app/references/auto-patterns-dashboard/entity-page-actions.md +70 -0
- package/skills/wix-app/references/auto-patterns-dashboard/entity-page-view-actions.md +73 -0
- package/skills/wix-app/references/auto-patterns-dashboard/entity-page.md +98 -0
- package/skills/wix-app/references/auto-patterns-dashboard/example-patterns.json +278 -0
- package/skills/wix-app/references/auto-patterns-dashboard/pages-configuration.md +94 -0
- package/skills/wix-app/references/auto-patterns-dashboard/resolved-action.md +43 -0
- package/skills/wix-app/references/auto-patterns-dashboard/sdk-utilities.md +66 -0
- package/skills/wix-app/references/auto-patterns-dashboard/views.md +76 -0
- package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +1 -14
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +54 -29
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +2 -2
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +17 -105
- package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +127 -0
- package/skills/wix-app/references/editor-react-component/PARTS.md +2 -1
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +15 -15
- package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +25 -53
- package/skills/wix-app/scripts/generate-auto-patterns.js +510 -0
- package/skills/wix-auth/SKILL.md +12 -0
- package/skills/wix-auth/references/device-flow.md +140 -0
- package/skills/wix-docs/SKILL.md +188 -0
- package/skills/wix-docs/references/API_SPEC_SEARCH.md +213 -0
- package/skills/wix-docs/references/EXTRACTING.md +120 -0
- package/skills/wix-headless/SKILL.md +84 -130
- package/skills/wix-headless/entry/bootstrap.mjs +93 -0
- package/skills/wix-headless/entry/skill.md +78 -0
- package/skills/wix-headless/references/AI_FEATURES.md +178 -0
- package/skills/wix-headless/references/CAPABILITIES.md +84 -0
- package/skills/wix-headless/references/DISCOVERY.md +34 -56
- package/skills/wix-headless/references/DOC_DISCOVERY.md +37 -0
- package/skills/wix-headless/references/FEEDBACK.md +118 -0
- package/skills/wix-headless/references/IMAGE_GENERATION.md +69 -0
- package/skills/wix-headless/references/SDK_HANDOFF.md +97 -0
- package/skills/wix-headless/references/SEED.md +44 -188
- package/skills/wix-headless/references/SETUP.md +32 -103
- package/skills/wix-headless/references/astro.md +98 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-blog.md +196 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +236 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-bookings.md +279 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-cms.md +163 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-events.md +203 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-forms.md +222 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-members-astro.md +124 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-members-custom-login.md +160 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-members-non-astro.md +118 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-portfolio.md +132 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-pricing-plans.md +124 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-orders.md +188 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-reservations.md +173 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-restaurants.md +161 -0
- package/skills/wix-headless/references/inline-recipes/setup-blog.md +175 -0
- package/skills/wix-headless/references/inline-recipes/setup-bookings.md +228 -0
- package/skills/wix-headless/references/inline-recipes/setup-cms.md +200 -0
- package/skills/wix-headless/references/inline-recipes/setup-events.md +196 -0
- package/skills/wix-headless/references/inline-recipes/setup-forms.md +174 -0
- package/skills/wix-headless/references/inline-recipes/setup-online-store.md +176 -0
- package/skills/wix-headless/references/inline-recipes/setup-portfolio.md +153 -0
- package/skills/wix-headless/references/inline-recipes/setup-pricing-plans.md +229 -0
- package/skills/wix-headless/references/inline-recipes/setup-restaurant-orders.md +161 -0
- package/skills/wix-headless/references/inline-recipes/setup-restaurant-reservations.md +117 -0
- package/skills/wix-headless/references/inline-recipes/setup-restaurants.md +152 -0
- package/skills/wix-headless/references/managed/AUTHENTICATION.md +57 -0
- package/skills/wix-headless/references/managed/CONNECT.md +74 -0
- package/skills/wix-headless/references/managed/CREATE.md +130 -0
- package/skills/wix-headless/references/managed/DEPLOYMENT.md +57 -0
- package/skills/wix-headless/references/non-astro.md +59 -0
- package/skills/wix-headless/references/self-managed/AUTHENTICATION.md +22 -0
- package/skills/wix-headless/references/self-managed/DEPLOYMENT.md +7 -0
- package/skills/wix-headless/references/stripe/AUTHENTICATION.md +55 -0
- package/skills/wix-headless/references/stripe/DEPLOYMENT.md +63 -0
- package/skills/wix-manage/SKILL.md +24 -1
- package/skills/wix-manage/references/analytics/query-site-analytics.md +241 -0
- package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +1 -1
- package/skills/wix-manage/references/bookings/diagnose-availability-issues.md +265 -0
- package/skills/wix-manage/references/marketing/create-and-publish-social-post.md +436 -0
- package/skills/wix-manage/references/marketing/generate-and-publish-marketing-plan.md +209 -0
- package/skills/wix-manage/references/rich-content/author-ricos-rich-content.md +249 -0
- package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +51 -0
- package/skills/wix-vibe-headless/SKILL.md +136 -0
- package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +128 -0
- package/skills/wix-vibe-headless/references/blog/wix-blog.js +217 -0
- package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +153 -0
- package/skills/wix-vibe-headless/references/bookings/wix-bookings-checkout.js +147 -0
- package/skills/wix-vibe-headless/references/bookings/wix-bookings-services.js +215 -0
- package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +154 -0
- package/skills/wix-vibe-headless/references/cms/wix-cms.js +186 -0
- package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +142 -0
- package/skills/wix-vibe-headless/references/events/wix-events-browse.js +135 -0
- package/skills/wix-vibe-headless/references/events/wix-events-registration.js +187 -0
- package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +211 -0
- package/skills/wix-vibe-headless/references/members/wix-members-auth.js +387 -0
- package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +111 -0
- package/skills/wix-vibe-headless/references/portfolio/wix-portfolio.js +194 -0
- package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +127 -0
- package/skills/wix-vibe-headless/references/pricing-plans/wix-pricing-plans.js +157 -0
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +138 -0
- package/skills/wix-vibe-headless/references/restaurants/wix-restaurants-menu.js +224 -0
- package/skills/wix-vibe-headless/references/restaurants/wix-restaurants-ordering.js +156 -0
- package/skills/wix-vibe-headless/references/restaurants/wix-restaurants-reservations.js +107 -0
- package/skills/wix-vibe-headless/references/shared/wix-client.js +186 -0
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +155 -0
- package/skills/wix-vibe-headless/references/storefront/wix-store-cart.js +147 -0
- package/skills/wix-vibe-headless/references/storefront/wix-store-catalog.js +142 -0
- package/skills/wix-headless/references/BUILD-astro.md +0 -253
- package/skills/wix-headless/references/BUILD-own-build.md +0 -167
- package/skills/wix-headless/references/BUILD.md +0 -105
- package/skills/wix-headless/references/DESIGN_SYSTEM.md +0 -165
- package/skills/wix-headless/references/DISCOVERY-connect.md +0 -55
- package/skills/wix-headless/references/DISCOVERY-create.md +0 -238
- package/skills/wix-headless/references/PLAN-connect.md +0 -19
- package/skills/wix-headless/references/PLAN-create.md +0 -17
- package/skills/wix-headless/references/PLAN.md +0 -92
- package/skills/wix-headless/references/astro/blog/BLOG_PAGES.md +0 -300
- package/skills/wix-headless/references/astro/blog/BLOG_SETUP.md +0 -218
- package/skills/wix-headless/references/astro/bookings/COMPONENTS.md +0 -45
- package/skills/wix-headless/references/astro/bookings/SERVICES_PAGES.md +0 -77
- package/skills/wix-headless/references/astro/cms/CMS_FOUNDATIONS.md +0 -214
- package/skills/wix-headless/references/astro/cms/FAQ_KNOWLEDGE_BASE.md +0 -231
- package/skills/wix-headless/references/astro/cms/PORTFOLIO.md +0 -453
- package/skills/wix-headless/references/astro/cms/RESOURCE_LIBRARY.md +0 -354
- package/skills/wix-headless/references/astro/cms/TEAM_DIRECTORY.md +0 -299
- package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +0 -351
- package/skills/wix-headless/references/astro/ecom/CART_PAGES.md +0 -119
- package/skills/wix-headless/references/astro/ecom/CART_WIRING.md +0 -103
- package/skills/wix-headless/references/astro/ecom/COMPONENTS_CSS.md +0 -132
- package/skills/wix-headless/references/astro/forms/CONTACT_FORM.md +0 -463
- package/skills/wix-headless/references/astro/gift-cards/COMPONENTS.md +0 -119
- package/skills/wix-headless/references/astro/gift-cards/PAGES.md +0 -129
- package/skills/wix-headless/references/astro/stores/BACK_IN_STOCK.md +0 -178
- package/skills/wix-headless/references/astro/stores/CATEGORY_PAGES.md +0 -85
- package/skills/wix-headless/references/astro/stores/COMPONENTS_CSS.md +0 -129
- package/skills/wix-headless/references/astro/stores/HOME_AND_NAV.md +0 -229
- package/skills/wix-headless/references/astro/stores/PRODUCT_PAGES.md +0 -215
- package/skills/wix-headless/references/astro/stores/SHARED_WIRING.md +0 -165
- package/skills/wix-headless/references/astro/templates/Layout.astro +0 -132
- package/skills/wix-headless/references/astro/templates/astro.config.mjs +0 -41
- package/skills/wix-headless/references/astro/templates/bookings/AvailabilityCalendar.tsx +0 -374
- package/skills/wix-headless/references/astro/templates/bookings/BookingForm.tsx +0 -136
- package/skills/wix-headless/references/astro/templates/bookings/SeoTags.astro +0 -25
- package/skills/wix-headless/references/astro/templates/bookings/ServiceBookingFlow.tsx +0 -71
- package/skills/wix-headless/references/astro/templates/bookings/ServiceCard.astro +0 -54
- package/skills/wix-headless/references/astro/templates/bookings/booking-confirmation.astro +0 -49
- package/skills/wix-headless/references/astro/templates/bookings/bookingDriver.ts +0 -245
- package/skills/wix-headless/references/astro/templates/bookings/components-bookings.css +0 -424
- package/skills/wix-headless/references/astro/templates/bookings/services/[slug].astro +0 -176
- package/skills/wix-headless/references/astro/templates/bookings/services/index.astro +0 -181
- package/skills/wix-headless/references/astro/templates/ecom/CartBadge.tsx +0 -84
- package/skills/wix-headless/references/astro/templates/ecom/CartView.tsx +0 -543
- package/skills/wix-headless/references/astro/templates/ecom/cart.astro +0 -13
- package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +0 -302
- package/skills/wix-headless/references/astro/templates/ecom/discounts.ts +0 -71
- package/skills/wix-headless/references/astro/templates/ecom/thank-you.astro +0 -24
- package/skills/wix-headless/references/astro/templates/gift-cards/GiftCardPurchase.tsx +0 -172
- package/skills/wix-headless/references/astro/templates/gift-cards/_home-teaser-snippet.astro +0 -42
- package/skills/wix-headless/references/astro/templates/gift-cards/_nav-snippet.astro +0 -11
- package/skills/wix-headless/references/astro/templates/gift-cards/components-gift-cards.css +0 -220
- package/skills/wix-headless/references/astro/templates/gift-cards/gift-cards.astro +0 -51
- package/skills/wix-headless/references/astro/templates/gift-cards/gift-cards.ts +0 -75
- package/skills/wix-headless/references/astro/templates/global.css +0 -288
- package/skills/wix-headless/references/astro/templates/stores/AddToCartButton.tsx +0 -77
- package/skills/wix-headless/references/astro/templates/stores/BackInStockForm.tsx +0 -176
- package/skills/wix-headless/references/astro/templates/stores/CategoryRail.astro +0 -69
- package/skills/wix-headless/references/astro/templates/stores/ProductCard.astro +0 -79
- package/skills/wix-headless/references/astro/templates/stores/ProductPurchase.tsx +0 -397
- package/skills/wix-headless/references/astro/templates/stores/SeoTags.astro +0 -21
- package/skills/wix-headless/references/astro/templates/stores/back-in-stock.ts +0 -67
- package/skills/wix-headless/references/astro/templates/stores/categories.ts +0 -155
- package/skills/wix-headless/references/astro/templates/stores/category/[slug].astro +0 -130
- package/skills/wix-headless/references/astro/templates/stores/components-stores.css +0 -400
- package/skills/wix-headless/references/astro/templates/stores/products/[slug].astro +0 -128
- package/skills/wix-headless/references/astro/templates/stores/products/index.astro +0 -101
- package/skills/wix-headless/references/blog/BLOG_CONTENT.md +0 -161
- package/skills/wix-headless/references/blog/INSTRUCTIONS.md +0 -32
- package/skills/wix-headless/references/bookings/FLOW.md +0 -246
- package/skills/wix-headless/references/bookings/INSTRUCTIONS.md +0 -95
- package/skills/wix-headless/references/bookings/SERVICES_DATA.md +0 -355
- package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +0 -176
- package/skills/wix-headless/references/cms/INSTRUCTIONS.md +0 -71
- package/skills/wix-headless/references/commands/known-apps.json +0 -6
- package/skills/wix-headless/references/custom/CONNECTION_PLAN.md +0 -142
- package/skills/wix-headless/references/custom/INSTRUCTIONS.md +0 -88
- package/skills/wix-headless/references/custom/blog/WIRING.md +0 -52
- package/skills/wix-headless/references/custom/bookings/WIRING.md +0 -197
- package/skills/wix-headless/references/custom/cms/WIRING.md +0 -97
- package/skills/wix-headless/references/custom/ecom/WIRING.md +0 -67
- package/skills/wix-headless/references/custom/forms/WIRING.md +0 -101
- package/skills/wix-headless/references/custom/stores/WIRING.md +0 -80
- package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +0 -59
- package/skills/wix-headless/references/forms/INSTRUCTIONS.md +0 -43
- package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +0 -51
- package/skills/wix-headless/references/images/INSTRUCTIONS.md +0 -357
- package/skills/wix-headless/references/seed-recipes.md +0 -49
- package/skills/wix-headless/references/shared/AGENTS_MD.md +0 -47
- package/skills/wix-headless/references/shared/AUTHENTICATION.md +0 -108
- package/skills/wix-headless/references/shared/BUILD_NOISE.md +0 -8
- package/skills/wix-headless/references/shared/DESIGN_MD.md +0 -84
- package/skills/wix-headless/references/shared/DOCS_SEARCH.md +0 -41
- package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +0 -186
- package/skills/wix-headless/references/shared/IMPLEMENTER.md +0 -206
- package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +0 -97
- package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +0 -143
- package/skills/wix-headless/references/shared/STYLING.md +0 -140
- package/skills/wix-headless/references/stores/INSTRUCTIONS.md +0 -126
- package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +0 -252
- package/skills/wix-headless/references/verticals/_schema.json +0 -74
- package/skills/wix-headless/references/verticals/_schema.md +0 -95
- package/skills/wix-headless/references/verticals/blog.md +0 -31
- package/skills/wix-headless/references/verticals/bookings.md +0 -41
- package/skills/wix-headless/references/verticals/cms.md +0 -30
- package/skills/wix-headless/references/verticals/ecom.md +0 -25
- package/skills/wix-headless/references/verticals/forms.md +0 -26
- package/skills/wix-headless/references/verticals/gift-cards.md +0 -24
- package/skills/wix-headless/references/verticals/stores.md +0 -33
- package/skills/wix-headless/scripts/check-manifest.mjs +0 -335
- package/skills/wix-headless/scripts/compose.mjs +0 -520
- package/skills/wix-headless/scripts/emit-design-tokens.mjs +0 -157
- package/skills/wix-headless/scripts/flatten.sh +0 -61
- package/skills/wix-headless/scripts/generate-images.mjs +0 -242
- package/skills/wix-headless/scripts/patch-decorative-slots.mjs +0 -154
- package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +0 -190
- package/skills/wix-headless/scripts/scaffold.sh +0 -139
- package/skills/wix-headless/scripts/seed-utilities.sh +0 -93
- package/skills/wix-headless/scripts/write-decorative-json.mjs +0 -62
- package/skills/wix-headless/shared-utilities/analytics.ts +0 -40
- package/skills/wix-headless/shared-utilities/ricos.ts +0 -179
- package/skills/wix-headless/shared-utilities/wix-image.ts +0 -72
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Non-Astro — the pinned docs to read *before* wiring a non-Astro frontend to Wix
|
|
2
|
+
|
|
3
|
+
This is the framework reference for any **non-Astro** frontend — React/Vue/Svelte/Vite SPA or plain static HTML. Astro stays the default (`astro.md`); read this when the user **names a framework** or **brings a non-Astro design**. Like `astro.md`, it's an **index of doc pages** with one-line "what it settles" notes, **then a Caveats section**. It carries **no design, templates, payloads, or per-framework code** — the model designs and writes the whole frontend; this file says only *how it connects*.
|
|
4
|
+
|
|
5
|
+
**This file is framework-axis only — it is mode-agnostic.** It is read in **both** the managed and self-managed flows, so it contains **no managed-vs-self-managed branching**: no `init` vs OAuth-app, no `wix release` vs external host, no `outputDirectory`, no `wix.config.json`. Anything that differs by *who hosts* lives in the project-type files (`managed/`, `self-managed/`) — you're already reading those in a known mode. Here is only what's **identical across both flows**: a non-Astro frontend talks to Wix through a manual `OAuthStrategy` visitor client + the SDK, the same way no matter who hosts it.
|
|
6
|
+
|
|
7
|
+
**The auth rule (the cross-skill boundary).** **Astro = auto-auth, no client. Non-Astro = manual client.** Unlike Astro, you create a client — `createClient({ modules, auth: OAuthStrategy({ clientId }) })`. For non-Astro this is the **documented, correct** model (the "Create a Client with OAuth" doc scopes itself to "frameworks other than Astro"). The `clientId` is the project's **public** OAuth client id — **not** a secret. **Where that id comes from is your flow's `AUTHENTICATION.md`** (managed: the `appId` in `wix.config.json`; self-managed: the OAuth app you created) — this file just *uses* it.
|
|
8
|
+
|
|
9
|
+
**Two sub-shapes, split on build — a framework fact, not a hosting fact:** **bundler SPA** (has a build step → `npm install` + `import`) vs **static HTML** (no build → load the SDK from a CDN). The caveats below split on that.
|
|
10
|
+
|
|
11
|
+
**How to use it.** Before authenticating or wiring data, read the pinned pages top-to-bottom — read-then-act, never invent a URL or a body from memory.
|
|
12
|
+
|
|
13
|
+
**URL form & how to read it.** Each link is the **`.md` twin** of a docs article. A page pinned here is **already curated — read it directly; don't re-discover it with search.** The two read paths take **different URL forms** — don't mix them:
|
|
14
|
+
|
|
15
|
+
- **`curl` the link — first priority. Fetch it as-is (keep the `.md`)** for raw markdown.
|
|
16
|
+
- **MCP doc tools — second priority** (discovery of a page this file doesn't pin, or a fallback if a fetch fails). Pass the URL *without* the `.md` suffix — `ReadFullDocsArticle` for the article pages here, `SearchWixSDKDocumentation` to reach SDK methods this file doesn't pin.
|
|
17
|
+
- **No MCP, or a shape not pinned anywhere → doc discovery** (`DOC_DISCOVERY.md`): a `curl` semantic search (`document_type: SDK`/`WIX_HEADLESS`) plus structured schema lookup, then read the hit's `.md?apiView=SDK`.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 1 — Authenticate (the heart — manual client, identical in both flows)
|
|
22
|
+
|
|
23
|
+
| Page | What it settles |
|
|
24
|
+
|---|---|
|
|
25
|
+
| <https://dev.wix.com/docs/go-headless/self-managed-headless/authentication/oauth/create-a-client-for-authentication-with-oauth.md> | **The model.** Install `@wix/sdk` + the domain packages, then `createClient({ modules, auth: OAuthStrategy({ clientId }) })`. clientId only, **no secret in the frontend**. Explicitly scoped to "frameworks other than Astro." Create the client **once** and reuse it. |
|
|
26
|
+
| <https://dev.wix.com/docs/sdk/core-modules/sdk/oauth-strategy.md> | **`OAuthStrategy` reference** — visitor sessions (automatic) vs member flows (managed/custom/external); token + session methods; confirms `clientId` only. |
|
|
27
|
+
| <https://dev.wix.com/docs/go-headless/self-managed-headless/authentication/visitors/handle-visitors-using-the-js-sdk.md> | **Visitors & members via the JS SDK** — visitor token sessions out of the box, and member login when the site needs it. Members are **first-class** on the non-Astro path (not deferred). |
|
|
28
|
+
| <https://dev.wix.com/docs/go-headless/self-managed-headless/authentication/members/wix-login-page/wix-managed-login-using-the-js-sdk.md> | **Member login (Wix login page)** — the manual `OAuthStrategy` handshake: `generateOAuthData → getAuthUrl → parseFromUrl → getMemberTokens → setTokens`, `logout`, `loggedIn()`. Login *is* sign-up (the Wix page logs in or registers); member tokens are the **same shape** as visitor tokens (`role: member`), so they reuse the visitor session machinery — login just swaps the token set. **`clientId` only (no secret); the connected site must be PUBLISHED and the `redirectUri` must be an exact-match allow-listed URI, or `getAuthUrl` fails; default to the Wix login page** over custom/external. **Full frontend contract → Read `inline-recipes/how-to-code-members-non-astro.md`** (local — Read it, don't curl). **Only if the brief explicitly asks for a custom/branded login form or custom sign-up fields → Read `inline-recipes/how-to-code-members-custom-login.md`** instead (`client.auth.register`/`login`; works on any project type — pick by intent, not project type). |
|
|
29
|
+
| <https://dev.wix.com/docs/sdk/articles/set-up-a-client/about-the-wix-client.md> | **Confirms non-Astro *does* need a client** — the "when you need a client vs not" list; non-Astro (managed or self-managed) is on the "needs a client" side, the mirror of Astro. |
|
|
30
|
+
|
|
31
|
+
> **clientId source is deferred.** This file uses the `clientId`; it does **not** say where it comes from. That's `{managed,self-managed}/AUTHENTICATION.md` — managed reads `appId` from `wix.config.json`; self-managed uses the OAuth app you created. Don't re-mint or re-fetch it if the flow already provides it.
|
|
32
|
+
|
|
33
|
+
## 2 — Frontend data access (identical in both flows)
|
|
34
|
+
|
|
35
|
+
All reads and writes go through the client from §1 — the SDK call shapes are framework-identical (the model adapts the idiom: React effect / Vue `onMounted` / Svelte store). For **which packages** a capability needs and the **SDK module docs** for each call shape, use `SDK_HANDOFF.md` §3 (the package map) — don't restate it here. For **what was seeded** and the IDs to bind, cross-link `SEED.md`; the frontend reads it with the visitor client.
|
|
36
|
+
|
|
37
|
+
| Page | What it settles |
|
|
38
|
+
|---|---|
|
|
39
|
+
| <https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/install-sdk-packages.md> | Installing `@wix/sdk` + domain packages and their current versions (bundler path). |
|
|
40
|
+
|
|
41
|
+
## 3 — Build the frontend (framework fact, not hosting)
|
|
42
|
+
|
|
43
|
+
- **Bundler SPA** — produce the build output with the project's own `npm run build`.
|
|
44
|
+
- **Static HTML** — there is **no build**; the HTML *is* the deployable artifact.
|
|
45
|
+
|
|
46
|
+
This file **stops at "produce the build output."** *Where that output is deployed and how* — `outputDirectory`, publish, origin registration, the `index.html`-at-root rule — is host-specific and lives in `{managed,self-managed}/DEPLOYMENT.md`, not here.
|
|
47
|
+
|
|
48
|
+
## 4 — Caveats (framework-invariant only)
|
|
49
|
+
|
|
50
|
+
These hold regardless of who hosts. Host-specific gotchas (static `outputDirectory`, the `index.html` rename) are filed in `managed/DEPLOYMENT.md`, where you're in a known mode. (Numbering: N2/N3 were retired; the gap is intentional and the remaining IDs are kept stable so inbound references don't shift.)
|
|
51
|
+
|
|
52
|
+
| Caveat | What it says |
|
|
53
|
+
|---|---|
|
|
54
|
+
| **N1 — No Wix scaffolder for a new non-Astro site** | There is **no** Wix command to scaffold a fresh React/Vue/static site — the non-Astro flow is connect-only. To *create* from scratch, the model runs the framework's **own** `npm create …` (e.g. `npm create vite@latest`), then the flow connects it. **Never infer a framework the user didn't name.** |
|
|
55
|
+
| **N4 — No-bundler sites load the SDK from a CDN** | With **no bundler** (static HTML), import the SDK in a `<script type="module">` from `https://esm.sh/@wix/sdk@1` (plus the domain packages the same way) — there's no `npm install` step to bundle it. With a bundler, use normal `npm install` + `import`. |
|
|
56
|
+
| **N5 — Client-only ⇒ no elevation ⇒ public-read** | A pure SPA/static frontend runs with a **visitor** token and **no server**, so there is no `auth.elevate`. CMS collections it reads must be **public-read**; anything member-scoped needs member auth. True regardless of who hosts. (Contrast Astro, which can elevate in a backend `/api` endpoint.) |
|
|
57
|
+
| **N6 — `clientId` is public; inline it** | The OAuth `clientId` is public, not a secret — it's fine to inline it directly in client code/bundle; there's no runtime secret to protect and no env-var indirection required. (Where the value comes from is still the flow's `AUTHENTICATION.md`.) |
|
|
58
|
+
| **N7 — Resolve `wix:image://` URIs with the SDK, never by hand** | SDK media fields (product/blog/CMS images) come back as internal identifiers like `wix:image://v1/<hash>/<file>#originWidth=…`, **not** ready URLs. Convert them with the SDK media module — `import { media } from '@wix/sdk'`, then `media.getScaledToFillImageUrl(uri, w, h, {})` (**returns the URL string directly — do NOT append `.url`; the 4th `options` arg is required, pass `{}`**), or `media.getImageUrl(uri).url` for the original (**that** one returns a `{ url }` object). The two shapes differ — mixing them (`getScaledToFillImageUrl(...).url`) resolves every image to `undefined`. Hand-building a `static.wixstatic.com/.../v1/fit/...` URL gets the format wrong and the image **403s** (or silently fails to load). Only `wix:image://` values need this — an already-absolute `https://` URL (e.g. an Unsplash placeholder) passes straight through. Docs: <https://dev.wix.com/docs/sdk/core-modules/sdk/media>. |
|
|
59
|
+
| **N8 — Member login is a manual `OAuthStrategy` round-trip on the same client** | Login (which *is* sign-up), logout and "am I a member?" run on the visitor client from §1 — don't build a second client. Drive the handshake yourself: `generateOAuthData → getAuthUrl → parseFromUrl → getMemberTokens → setTokens`, `logout`, `loggedIn()`; **persist and renew** member tokens exactly like visitor tokens (`renewToken`, re-hydrate with `setTokens` on boot). Preconditions that bite: **`clientId` only**, **site PUBLISHED**, **`redirectUri` allow-listed exact-match**, **default to the Wix login page**. Read the current member with **`@wix/members` `getCurrentMember`** (not the dev-preview `@wix/site-members`). **No `auth.elevate`** — a member reads their own data under the member token, and a serverless SPA has no elevation anyway (N5). Full contract: `inline-recipes/how-to-code-members-non-astro.md`. |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Authentication — self-managed (TBD)
|
|
2
|
+
|
|
3
|
+
For a **self-managed** project (self-hosted, where the user manages their own hosting and credential supply), the authentication method is **not yet decided — TBD**.
|
|
4
|
+
|
|
5
|
+
When defined, this file must specify how `self-managed` obtains, for the rest of the (project-type-agnostic) flow:
|
|
6
|
+
|
|
7
|
+
- **`$TOKEN`** — a bearer token authorized for the metasite (used as `Authorization: Bearer $TOKEN`).
|
|
8
|
+
- **`$SITE_ID`** — the metasite id (used as the `wix-site-id` header on every site-scoped call).
|
|
9
|
+
- **`clientId`** — the OAuth app's public client id for the frontend's `OAuthStrategy` (the OAuth **app id and client id are the same value** — app-id === client-id).
|
|
10
|
+
|
|
11
|
+
It then ends at the same universal REST call shape every type uses:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
curl -sS -w "\nHTTP_STATUS:%{http_code}" \
|
|
15
|
+
-X POST "https://www.wixapis.com/<endpoint>" \
|
|
16
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
17
|
+
-H "wix-site-id: $SITE_ID" \
|
|
18
|
+
-H "Content-Type: application/json" \
|
|
19
|
+
-d '<body>'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
> **TBD.** Until the self-managed auth method is defined, a `self-managed` run can't obtain a token — **stop with a clear error** and tell the user this project type isn't wired yet.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Deployment — self-managed (TBD)
|
|
2
|
+
|
|
3
|
+
For a **self-managed** project, the deploy/finalize steps are **not yet decided — TBD**.
|
|
4
|
+
|
|
5
|
+
Because hosting is the user's (not Wix's), this will likely mirror the self-hosted finalize pattern — **publish the metasite** and **register the deployed origin** on the OAuth app once the live URL is known (see `../stripe/DEPLOYMENT.md` for that shape) — but the exact mechanism, and how credentials/URL are supplied, are TBD.
|
|
6
|
+
|
|
7
|
+
> **TBD.** Until this is defined, tell the user that `self-managed` deployment isn't wired yet, and that the frontend's visitor calls will be rejected until its origin is registered on the OAuth app.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Authentication — stripe (Stripe Projects → Wix)
|
|
2
|
+
|
|
3
|
+
For a **stripe** project (self-hosted, provisioned via Stripe Projects), every Wix call is a plain `curl` against `wixapis.com` with a bearer token. The credentials come from the project's `.env` (synced by Stripe Projects when Wix was connected), and the token is minted directly from the OAuth client-credentials grant. This file is the authority for how `stripe` obtains `$TOKEN`, `$SITE_ID`, and the public `clientId`; the flow files defer here.
|
|
4
|
+
|
|
5
|
+
## Inputs from `.env`
|
|
6
|
+
|
|
7
|
+
Stripe Projects namespaces each provider's vars, and Wix's own names already begin with `WIX_`, so a real provision yields a **doubled prefix**:
|
|
8
|
+
|
|
9
|
+
| Var | Role |
|
|
10
|
+
| ----------------------- | ------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| `WIX_WIX_CLIENT_ID` | the OAuth app `client_id` — also the frontend `OAuthStrategy({ clientId })` |
|
|
12
|
+
| `WIX_WIX_CLIENT_SECRET` | the OAuth app `client_secret` — **server-side only**; mints the token, never goes to the frontend |
|
|
13
|
+
| `WIX_WIX_METASITE_ID` | the metasite id → the `wix-site-id` header on every site-scoped call |
|
|
14
|
+
|
|
15
|
+
The plain `WIX_*` names are accepted as a fallback (in case the provider definition changes). Read them at runtime. If `client_id`/`client_secret` are absent, Wix isn't connected in this project — **stop with a clear error**.
|
|
16
|
+
|
|
17
|
+
The public `clientId` for the frontend's `OAuthStrategy` is `WIX_WIX_CLIENT_ID` (not secret).
|
|
18
|
+
|
|
19
|
+
## Minting the token — inline, secret stays out of context
|
|
20
|
+
|
|
21
|
+
Run this as a **single Bash call**. It sources `.env` *inside the shell*, so the command text references `$WIX_WIX_CLIENT_SECRET` but the secret value is never typed, printed, or returned. The minted token is written to a tmp file so later calls reuse it **without re-minting and without the token entering the model context**:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
set -a; . ./.env; set +a
|
|
25
|
+
curl -sS -X POST "https://www.wixapis.com/oauth2/token" \
|
|
26
|
+
-H "Content-Type: application/json" \
|
|
27
|
+
-d "{\"grant_type\":\"client_credentials\",\"client_id\":\"${WIX_WIX_CLIENT_ID:-$WIX_CLIENT_ID}\",\"client_secret\":\"${WIX_WIX_CLIENT_SECRET:-$WIX_CLIENT_SECRET}\"}" \
|
|
28
|
+
| python3 -c "import sys,json;print(json.load(sys.stdin)['access_token'])" > /tmp/wix_token \
|
|
29
|
+
&& test -s /tmp/wix_token && echo "token minted" || echo "MINT FAILED — Wix not connected, or app/creds invalid"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
That endpoint returns `{ "access_token": "<…>", "token_type": "Bearer", "expires_in": 14400 }`. `instance_id` is **optional and omitted**. The token is a real OAuth token with a **4-hour expiry**.
|
|
33
|
+
|
|
34
|
+
> **Shell state does not persist between Bash calls** — that is *why* the token goes to `/tmp/wix_token`. Mint once at the start of the run; every later call reads it back. Each mint here returns a *different, equally valid* token; "mint once" is for simplicity, not because re-minting is pointless.
|
|
35
|
+
|
|
36
|
+
## REST call shape
|
|
37
|
+
|
|
38
|
+
Every later call re-sources `.env` (for the non-secret metasite id) and reads the token from the tmp file — both cheap, both keep secrets out of context:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
set -a; . ./.env; set +a
|
|
42
|
+
TOKEN=$(cat /tmp/wix_token)
|
|
43
|
+
SITE_ID="${WIX_WIX_METASITE_ID:-$WIX_METASITE_ID}"
|
|
44
|
+
curl -sS -w "\nHTTP_STATUS:%{http_code}" \
|
|
45
|
+
-X POST "https://www.wixapis.com/<endpoint>" \
|
|
46
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
47
|
+
-H "wix-site-id: $SITE_ID" \
|
|
48
|
+
-H "Content-Type: application/json" \
|
|
49
|
+
-d '<body>'
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- **`Authorization: Bearer $TOKEN`** — the `Bearer` prefix is required.
|
|
53
|
+
- **`wix-site-id: $SITE_ID`** — required by every site-scoped family (Stores v3, CMS v2, Blog v3, Forms v4, Apps-Installer v1, …). Harmless where unread; include it always.
|
|
54
|
+
- **`Content-Type: application/json`** — on every POST/PATCH body.
|
|
55
|
+
- **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.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Deployment — stripe (self-hosted; publish + register origin)
|
|
2
|
+
|
|
3
|
+
For a **stripe** project, hosting is the user's, so two one-time backend actions finalize the live site. Both use the token from this folder's `AUTHENTICATION.md`; run them once the deployed site is up.
|
|
4
|
+
|
|
5
|
+
## 1 · Publish the Wix site
|
|
6
|
+
|
|
7
|
+
**Always publish the metasite after deploying.** Some Wix-served flows the frontend relies on (redirects to Wix-hosted pages and other features served from the published site) only work once the site has been published. Just publish every time, so a flow that needs it never silently fails. The call is idempotent and takes **no body**:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
set -a; . ./.env; set +a
|
|
11
|
+
TOKEN=$(cat /tmp/wix_token); SITE_ID="${WIX_WIX_METASITE_ID:-$WIX_METASITE_ID}"
|
|
12
|
+
curl -sS -w "\nHTTP_STATUS:%{http_code}" \
|
|
13
|
+
-X POST "https://www.wixapis.com/site-publisher/v1/site/publish" \
|
|
14
|
+
-H "Authorization: Bearer $TOKEN" -H "wix-site-id: $SITE_ID" \
|
|
15
|
+
-H "Content-Type: application/json" -d '{}'
|
|
16
|
+
# 200 with an empty body `{}` means published — that 200 is the only success signal (no URL is returned).
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 2 · Register the deployed origin on the OAuth app
|
|
20
|
+
|
|
21
|
+
For the frontend's visitor calls (`OAuthStrategy` with the public `clientId`) to be **accepted from the deployed site**, the site's origin must be on the OAuth app's allowed domains. Otherwise every browser SDK call from the live URL is rejected.
|
|
22
|
+
|
|
23
|
+
We don't own the hosting, so the deployed URL is unknown until the site is deployed — this is a **post-deploy step performed once the URL is known** (it can't be done during Setup/Seed). The OAuth app's id **is the `clientId`** — `WIX_WIX_CLIENT_ID`.
|
|
24
|
+
|
|
25
|
+
### Idempotent — register a given URL only once
|
|
26
|
+
|
|
27
|
+
First **read** the app's current allowed domains; if the deployed origin is already present, the registration is already done — **skip it**. Only ever add a URL that isn't there yet.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
set -a; . ./.env; set +a
|
|
31
|
+
TOKEN=$(cat /tmp/wix_token); ID="${WIX_WIX_CLIENT_ID:-$WIX_CLIENT_ID}"
|
|
32
|
+
curl -sS -w "\nHTTP_STATUS:%{http_code}" \
|
|
33
|
+
"https://www.wixapis.com/oauth-app/v1/oauth-apps/$ID" \
|
|
34
|
+
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json"
|
|
35
|
+
# → read oAuthApp.allowedRedirectDomains; if the deployed origin is already in it, you're done.
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Add the deployed origin
|
|
39
|
+
|
|
40
|
+
`PATCH` the app, sending the **existing** `allowedRedirectDomains` **plus** the new origin (the API replaces the field, so include what's already there), with a field mask:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
set -a; . ./.env; set +a
|
|
44
|
+
TOKEN=$(cat /tmp/wix_token); ID="${WIX_WIX_CLIENT_ID:-$WIX_CLIENT_ID}"
|
|
45
|
+
curl -sS -w "\nHTTP_STATUS:%{http_code}" -X PATCH \
|
|
46
|
+
"https://www.wixapis.com/oauth-app/v1/oauth-apps/$ID" \
|
|
47
|
+
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
|
|
48
|
+
-d '{
|
|
49
|
+
"oAuthApp": { "id": "'"$ID"'", "allowedRedirectDomains": [ <existing…>, "<deployed-origin>" ] },
|
|
50
|
+
"mask": { "paths": ["allowedRedirectDomains"] }
|
|
51
|
+
}'
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- `<deployed-origin>` is the live site's domain/URL (what the browser SDK runs on).
|
|
55
|
+
- For the **exact field semantics and format** (domain vs. full URL, member-login redirect URIs vs. allowed domains), read the doc — don't guess: <https://dev.wix.com/docs/api-reference/business-management/headless/oauth-apps/update-oauth-app.md>. Member-login redirect URIs are a **separate field** (`allowedRedirectUris`) from the origin (`allowedRedirectDomains`): the visitor SDK only needs the origin allowed, but **if this deploy has member login via the Wix login page, the member-login callback must also be registered** in `allowedRedirectUris` — same masked-`PATCH` shape as the origin (add both under one `mask.paths`), and required or login 4xxs. Mechanics + the "not read-only" gotcha: `../managed/DEPLOYMENT.md` → "Member login on a non-Astro frontend". (Custom login — `../inline-recipes/how-to-code-members-custom-login.md` — needs neither, as it has no login-page redirect.)
|
|
56
|
+
|
|
57
|
+
> **If the live site's visitor token call still 400s after the origin is registered, suspect the bundle — not CORS.** An unregistered origin and an `undefined` `clientId` in the build produce the same browser-side 400. Before chasing CORS/propagation, confirm the real `clientId` value is actually inlined in the deployed bundle (see `../SDK_HANDOFF.md` §2).
|
|
58
|
+
|
|
59
|
+
## If deployment is NOT part of this agent flow
|
|
60
|
+
|
|
61
|
+
If the agent isn't the one deploying — the user will deploy the site themselves — the skill **cannot know the deployed URL**, so it cannot register the origin. (It can still publish the site — step 1 doesn't need the URL.) **Flag the origin step to the user clearly**, e.g.:
|
|
62
|
+
|
|
63
|
+
> *"One required step remains before the frontend can talk to Wix: once your site is live, its URL must be registered on the Wix OAuth app (allowed domains). Give me the deployed URL — or re-run this skill with it — and I'll register it. Until then, Wix SDK calls from the live site will be rejected."*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wix-manage
|
|
3
|
-
description: "Wix business solution management recipes — REST API operations for configuring and managing Wix business solutions. Routes to: stores, bookings, get-paid, CMS, contacts, forms, media, app-installation, pricing-plans, restaurants, rich-content, sites, blog, calendar, domains, site-properties, ecommerce."
|
|
3
|
+
description: "Wix business solution management recipes — REST API operations for configuring and managing Wix business solutions. Routes to: stores, bookings, get-paid, CMS, contacts, forms, media, app-installation, pricing-plans, restaurants, rich-content, sites, blog, calendar, domains, site-properties, ecommerce, marketing, analytics."
|
|
4
4
|
compatibility: Requires Wix REST API access (API key or OAuth).
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -31,6 +31,13 @@ These recipes do NOT cover frontend development or SDK usage for displaying data
|
|
|
31
31
|
|
|
32
32
|
---
|
|
33
33
|
|
|
34
|
+
## Analytics
|
|
35
|
+
|
|
36
|
+
### [Query Site Analytics](references/analytics/query-site-analytics.md)
|
|
37
|
+
**Technical:** Reads a site's analytics through the Semantic Model API. Covers listing semantic models, inspecting a model's schema (measures, dimensions, parameters), and querying data with a required time interval, filters, sorting, paging, and human-readable formatting. Key endpoints: /analytics/semantic-model/v3/semantic-models, /semantic-models/{id}, /semantic-models/query-data.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
34
41
|
## Blog
|
|
35
42
|
|
|
36
43
|
### [How to Create Blog Posts](references/blog/how-to-create-blog-posts.md)
|
|
@@ -64,6 +71,9 @@ These recipes do NOT cover frontend development or SDK usage for displaying data
|
|
|
64
71
|
### [Create Course Service](references/bookings/create-course-service.md)
|
|
65
72
|
**Technical:** Use when the user wants to create a multi-session course — e.g. "create a 6-week workshop", "set up a training program for $300". Handles group capacity, full-course pricing, and fixed series via bulkCreateServices API.
|
|
66
73
|
|
|
74
|
+
### [Diagnose Bookings Availability Issues](references/bookings/diagnose-availability-issues.md)
|
|
75
|
+
**Technical:** Use when an appointment-based service has no bookable time slots / "customers can't book". Runs the DiagnoseAvailability endpoint (`POST /v2/time-slots/diagnose`) for ordered, machine-readable reason codes with suggested owner actions, and falls back to ListAvailabilityTimeSlots when the endpoint is inconclusive.
|
|
76
|
+
|
|
67
77
|
### [End-to-End Booking Flow](references/bookings/end-to-end-booking-flow.md)
|
|
68
78
|
**Technical:** Complete booking flow from service discovery to payment. Query services, check availability with Time Slots V2, create bookings, and process payment via eCommerce checkout.
|
|
69
79
|
|
|
@@ -184,6 +194,16 @@ These recipes do NOT cover frontend development or SDK usage for displaying data
|
|
|
184
194
|
|
|
185
195
|
---
|
|
186
196
|
|
|
197
|
+
## Marketing
|
|
198
|
+
|
|
199
|
+
### [Create and Publish a Social Media Post (with AI generation)](references/marketing/create-and-publish-social-post.md)
|
|
200
|
+
**Technical:** Creates and publishes (or schedules) a social media post to a connected channel (Instagram, Facebook, LinkedIn, TikTok, Pinterest, YouTube, Google Business Profile) via the Publisher API. Optionally generates the whole post from a free-text idea or the site's own assets (products, blog posts, events, bookings, coupons, categories), generates caption/title suggestions, and edits an existing image with AI. Verifies the channel is connected (and runs the OAuth connect flow if not), checks premium publishing quota, creates a draft item, then publishes it immediately or schedules it for a future date. Use when the user wants to create, generate, write, post, or schedule a social post (e.g. "post this to Instagram", "make a post from my product", "write a caption", "schedule a post").
|
|
201
|
+
|
|
202
|
+
### [Generate a Marketing Plan and Schedule Its Posts](references/marketing/generate-and-publish-marketing-plan.md)
|
|
203
|
+
**Technical:** Generates a site's AI social media marketing plan (a calendar of marketing activities, each with per-channel post drafts) via the Marketing Plan API, then schedules the drafts for publishing. Covers optional marketing settings (goal, channels, tone, frequency, content pillars), asynchronous generation with polling, and generating posts for additional activities. Use for "generate a marketing plan", "create a social media plan/calendar", or "schedule my plan's posts".
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
187
207
|
## Media
|
|
188
208
|
|
|
189
209
|
### [Upload Media to Wix](references/media/upload-media-to-wix.md)
|
|
@@ -213,6 +233,9 @@ These recipes do NOT cover frontend development or SDK usage for displaying data
|
|
|
213
233
|
### [Ricos Converter Service](references/rich-content/ricos-converter-service.md)
|
|
214
234
|
**Technical:** Validates and converts content between Ricos documents and HTML/Markdown/plain text using the Ricos Documents API. Covers plugin configuration, format conversion in both directions, and document validation.
|
|
215
235
|
|
|
236
|
+
### [Author Ricos Rich Content](references/rich-content/author-ricos-rich-content.md)
|
|
237
|
+
**Technical:** Hand-authoring valid Ricos rich-content JSON (the richContent/nodes tree) reused across Blog, Stores, Events, and CMS. Covers every common node shape — paragraphs, headings, lists, blockquotes, dividers, tables with cell fills, code blocks, images — plus inline text decorations and the nesting rules the format enforces.
|
|
238
|
+
|
|
216
239
|
---
|
|
217
240
|
|
|
218
241
|
## Site Properties
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Query Site Analytics"
|
|
3
|
+
description: Retrieve a Wix site's analytics through the Semantic Model API. Covers listing semantic models, inspecting a model's schema (measures, dimensions, parameters), and querying model data with a required time interval, filters, sorting, paging, and human-readable formatting.
|
|
4
|
+
---
|
|
5
|
+
# Query Site Analytics
|
|
6
|
+
|
|
7
|
+
This article shows how to read a site's analytics with the **Semantic Model API**. A semantic model describes one analytics subject area (such as site traffic, revenue, etc.) and defines the **measures**, **dimensions**, and **parameters** you can query.
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
1. The app/caller has the **Site Analytics – read** permission scope (`SCOPE.DC-ANALYTICS-AND-REPORTS.READ-SITE-ANALYTICS`).
|
|
12
|
+
2. A site context is available (the request is authorized against a specific site).
|
|
13
|
+
|
|
14
|
+
## Required APIs
|
|
15
|
+
|
|
16
|
+
- **Semantic Model API**: [REST](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/introduction)
|
|
17
|
+
- **Site Properties API** (for the site's time zone): [REST](https://dev.wix.com/docs/api-reference/business-management/site-properties/properties/get-site-properties)
|
|
18
|
+
|
|
19
|
+
Base path: `https://www.wixapis.com/analytics/semantic-model/v3`
|
|
20
|
+
|
|
21
|
+
| Step | Method | Endpoint |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| List models | `GET` | `/semantic-models` |
|
|
24
|
+
| Get model schema | `GET` | `/semantic-models/{semanticModelId}` |
|
|
25
|
+
| Query model data | `POST` | `/semantic-models/query-data` |
|
|
26
|
+
|
|
27
|
+
## Decision flow
|
|
28
|
+
|
|
29
|
+
Always follow **List → Get → Query**. You cannot construct a valid query without first discovering the model's field names from `Get Semantic Model`.
|
|
30
|
+
|
|
31
|
+
1. **List Semantic Models** — discover which subject areas exist and their IDs.
|
|
32
|
+
2. **Get Semantic Model** — inspect a model's `measures`, `dimensions`, and `parameters` to find the exact `name` values to query and their supported filters/sorting.
|
|
33
|
+
3. **Query Semantic Model Data** — request specific field names for a time `interval`, with optional filters, sorting, paging, and formatting.
|
|
34
|
+
|
|
35
|
+
## Before you begin (sharp edges)
|
|
36
|
+
|
|
37
|
+
- **`interval` is required on every query.** There is no way to query without a date range — omitting it fails.
|
|
38
|
+
- **`interval` is start-inclusive, end-exclusive (`[start, end)`).** `start` is included, `end` is not. To get all of January 2026, query `start: "2026-01-01..."` and `end: "2026-02-01..."` — you get Jan 1–31, and Feb 1 is excluded. Set `end` to the day *after* the last day you want.
|
|
39
|
+
- **Set `interval.timezone` to the site's time zone to match the Wix dashboard.** Analytics in the Wix business manager are bucketed by the site's time zone. If `interval.timezone` is omitted it defaults to **UTC**, so day boundaries shift and your numbers won't match what the owner sees in the dashboard (and the same goes for using a different time zone). Get the site's IANA time zone from `properties.timeZone` via [Get Site Properties](https://dev.wix.com/docs/api-reference/business-management/site-properties/properties/get-site-properties) (`GET https://www.wixapis.com/site-properties/v4/properties`) and pass it through.
|
|
40
|
+
- **Field names must come from `Get Semantic Model`.** The `fields`, `filters[].field`, and `sort.fieldName` values must exactly match a `name` returned by the model schema (e.g. `traffic.sessions_count`). Do not guess field names.
|
|
41
|
+
- **Field dependencies.** A field returns data only if at least one of the field names in its `dependencies` array is also included in the same query; otherwise it's **silently omitted** from results (no error). For example, a measure may only return data when a specific dimension is also requested.
|
|
42
|
+
- **Sorting a nullable measure — set `sort.nullsLast: true`.** `nullsLast` defaults to `false` and only affects **descending** (`DESC`) order. If a measure can return null and you sort it `DESC`, the null rows sort *first* — so a "top N" query surfaces nulls before your real values. Set `nullsLast: true` to push nulls to the end.
|
|
43
|
+
- **Result cap: 1,000 rows per query.** `results` is capped at 1,000 rows — paginate with `paging.offset` for larger datasets.
|
|
44
|
+
- **Formatting is opt-in.** Set `formattingEnabled: true` to also receive a human-readable `formattedValue` per cell (e.g. `1500` → `"$1,500.00"` or `1.5K`). Raw typed values are always returned.
|
|
45
|
+
- **Totals are opt-in.** Set `totalsIncluded: true` to get a `totals` row summing numeric fields across the **full (unpaginated)** result set.
|
|
46
|
+
- **Unique fields are not additive.** For `unique` measures (e.g. unique visitors), query the exact time range you want in a **single request** — never sum values from separate date-range queries. Uniques are deduplicated within each queried range, so adding per-range results double-counts anyone who appears in more than one range and overstates the true total.
|
|
47
|
+
|
|
48
|
+
## Step 1: List semantic models
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
curl -X GET \
|
|
52
|
+
'https://www.wixapis.com/analytics/semantic-model/v3/semantic-models' \
|
|
53
|
+
-H 'Authorization: <AUTH>'
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Response:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"semanticModels": [
|
|
61
|
+
{ "id": "cad7fd34-2c8b-4dda-8296-3f9d47fb484d", "slug": "traffic", "description": "Site traffic", "keywords": ["sessions", "views"] }
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Pick the model whose subject area matches the request, and keep its `id`.
|
|
67
|
+
|
|
68
|
+
## Step 2: Get the model schema
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
curl -X GET \
|
|
72
|
+
'https://www.wixapis.com/analytics/semantic-model/v3/semantic-models/cad7fd34-2c8b-4dda-8296-3f9d47fb484d' \
|
|
73
|
+
-H 'Authorization: <AUTH>'
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Response shape:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"semanticModel": {
|
|
81
|
+
"id": "string<GUID>",
|
|
82
|
+
"slug": "string",
|
|
83
|
+
"description": "string",
|
|
84
|
+
"keywords": ["string"],
|
|
85
|
+
"measures": [ "Field" ],
|
|
86
|
+
"dimensions": [ "Field" ],
|
|
87
|
+
"parameters": [ "Field" ]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Each `Field` (in `measures`, `dimensions`, and `parameters`):
|
|
93
|
+
|
|
94
|
+
| Property | Meaning |
|
|
95
|
+
|---|---|
|
|
96
|
+
| `name` | The exact value to use in `fields`, `filters[].field`, and `sort.fieldName`. |
|
|
97
|
+
| `type` | `STRING`, `NUMBER`, `BOOLEAN`, `DATE`, `DATE_TIME`, `OBJECT`, or `ARRAY`. |
|
|
98
|
+
| `filters` | Supported filter `prefixes` (`IS`/`NOT`) and `conditions` (e.g. `EQUAL`, `RANGE_II`, `CONTAINS_ANY`). |
|
|
99
|
+
| `sortable` | Whether the field can be used in `sort`. |
|
|
100
|
+
| `enumerations` | Allowed values, for enumerated fields. |
|
|
101
|
+
| `dependencies` | Other field names this field needs present in the query to return data (see sharp edges). |
|
|
102
|
+
| `groupSlug` | Fields sharing a `groupSlug` are logically related. |
|
|
103
|
+
| `description` | Human-readable description of the field. |
|
|
104
|
+
|
|
105
|
+
- **Measures** are quantitative fields you aggregate (revenue, page views, order count).
|
|
106
|
+
- **Dimensions** are categorical fields you group by (traffic source, country, product name).
|
|
107
|
+
- **Parameters** are optional inputs that customize query behavior (currency, date granularity).
|
|
108
|
+
|
|
109
|
+
## Step 3: Query the model data
|
|
110
|
+
|
|
111
|
+
`POST /semantic-models/query-data` (body requires `Content-Type: application/json`).
|
|
112
|
+
|
|
113
|
+
Required body fields: `semanticModelId`, `interval`, `fields`.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
curl -X POST \
|
|
117
|
+
'https://www.wixapis.com/analytics/semantic-model/v3/semantic-models/query-data' \
|
|
118
|
+
-H 'Authorization: <AUTH>' \
|
|
119
|
+
-H 'Content-Type: application/json' \
|
|
120
|
+
-d '{
|
|
121
|
+
"semanticModelId": "cad7fd34-2c8b-4dda-8296-3f9d47fb484d",
|
|
122
|
+
"interval": {
|
|
123
|
+
"start": "2024-06-01T00:00:00.000Z",
|
|
124
|
+
"end": "2025-06-01T00:00:00.000Z",
|
|
125
|
+
"timezone": "America/New_York"
|
|
126
|
+
},
|
|
127
|
+
"fields": [
|
|
128
|
+
"traffic.referrer_category_name",
|
|
129
|
+
"traffic.sessions_count",
|
|
130
|
+
"traffic.views_count"
|
|
131
|
+
],
|
|
132
|
+
"filters": [
|
|
133
|
+
{
|
|
134
|
+
"field": "traffic.sessions_count",
|
|
135
|
+
"condition": "GREATER_THAN",
|
|
136
|
+
"values": ["100"]
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"sort": {
|
|
140
|
+
"fieldName": "traffic.sessions_count",
|
|
141
|
+
"order": "DESC",
|
|
142
|
+
"nullsLast": true
|
|
143
|
+
},
|
|
144
|
+
"paging": {
|
|
145
|
+
"limit": 50,
|
|
146
|
+
"offset": 0
|
|
147
|
+
},
|
|
148
|
+
"formattingEnabled": true,
|
|
149
|
+
"totalsIncluded": true
|
|
150
|
+
}'
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Request fields
|
|
154
|
+
|
|
155
|
+
| Field | Required | Notes |
|
|
156
|
+
|---|---|---|
|
|
157
|
+
| `semanticModelId` | Yes | GUID from List/Get. |
|
|
158
|
+
| `interval` | Yes | `{ start, end }` UTC ISO date-times, plus `timezone`. Range is start-inclusive, end-exclusive (`[start, end)`) — set `end` to the day after the last day you want. Set `timezone` to the site's IANA time zone (see Time zone section) so results match the Wix dashboard; defaults to UTC when omitted. |
|
|
159
|
+
| `fields` | Yes | Up to 60 field `name`s from the model schema. |
|
|
160
|
+
| `filters` | No | Array of `{ field, values[], condition, prefix }`. `condition` defaults to `EQUAL`, `prefix` defaults to `IS`. For `RANGE_*` conditions provide exactly 2 values. |
|
|
161
|
+
| `sort` | No | `{ fieldName, order, nullsLast }`. `order` defaults to `ASC`; field must be `sortable`. `nullsLast` (default `false`) applies only to `DESC` order — set it to `true` when the sorted measure can contain nulls, otherwise nulls sort before real values. |
|
|
162
|
+
| `paging` | No | `{ limit, offset }`. Defaults: `limit` 50, `offset` 0. |
|
|
163
|
+
| `formattingEnabled` | No | Default `false`. Adds `formattedValue` per cell. |
|
|
164
|
+
| `totalsIncluded` | No | Default `false`. Adds a `totals` row. |
|
|
165
|
+
|
|
166
|
+
### Response shape
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"results": [
|
|
171
|
+
{
|
|
172
|
+
"fields": {
|
|
173
|
+
"traffic.referrer_category_name": { "stringValue": "Search", "formattedValue": "Search" },
|
|
174
|
+
"traffic.sessions_count": { "numericValue": 1500, "formattedValue": "1.5K" }
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"pagingMetadata": { "count": 5, "offset": 0 },
|
|
179
|
+
"totals": { "fields": { "traffic.sessions_count": { "numericValue": 9000 } } }
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Each cell in `results[].fields` is a typed value — one of `numericValue`, `stringValue`, `booleanValue`, `timestampValue`, `arrayValue`, or `objectValue` — plus `formattedValue` when `formattingEnabled` is `true`. `totals` is present only when `totalsIncluded` is `true`.
|
|
184
|
+
|
|
185
|
+
## Time zone (match the Wix dashboard)
|
|
186
|
+
|
|
187
|
+
Analytics shown in the Wix business manager are aggregated by the **site's time zone**. To return numbers that match what the site owner sees, pass that time zone in `interval.timezone` on every query. **When `timezone` is omitted, the API defaults to UTC** — which shifts day boundaries and produces totals that don't line up with the dashboard (the same applies to any non-site time zone).
|
|
188
|
+
|
|
189
|
+
Get the site's time zone from **Get Site Properties**:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
curl -X GET \
|
|
193
|
+
'https://www.wixapis.com/site-properties/v4/properties?fields.paths=timeZone' \
|
|
194
|
+
-H 'Authorization: <AUTH>'
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
The IANA time zone string is returned in `properties.timeZone`:
|
|
198
|
+
|
|
199
|
+
```json
|
|
200
|
+
{
|
|
201
|
+
"properties": {
|
|
202
|
+
"timeZone": "America/New_York"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Use that value as `interval.timezone` in `Query Semantic Model Data`. The Site Properties `timeZone` reflects the site's primary business address and requires the `SITE_SETTINGS.VIEW` permission.
|
|
208
|
+
|
|
209
|
+
## Pagination
|
|
210
|
+
|
|
211
|
+
To retrieve more than 1,000 rows, page through with `offset`:
|
|
212
|
+
|
|
213
|
+
1. Request page 1 with `paging: { limit: 1000, offset: 0 }`.
|
|
214
|
+
2. Increment `offset` by the page size until `pagingMetadata.count` is less than the requested `limit`.
|
|
215
|
+
|
|
216
|
+
## Common Errors
|
|
217
|
+
|
|
218
|
+
| HTTP | Code | Meaning |
|
|
219
|
+
|---|---|---|
|
|
220
|
+
| 401 | `NO_ACCOUNT_IDENTITY` / `UNAUTHENTICATED` | Caller isn't authenticated; provide valid credentials. |
|
|
221
|
+
| 404 | `SEMANTIC_MODEL_NOT_FOUND` | The `semanticModelId` doesn't exist for this site. |
|
|
222
|
+
|
|
223
|
+
Silent gap (no error): a requested field returns no data because none of its `dependencies` were included in the query — add a dependency field and re-query.
|
|
224
|
+
|
|
225
|
+
## Best Practices
|
|
226
|
+
|
|
227
|
+
1. Always run **List → Get → Query**; never hardcode field names — read them from `Get Semantic Model`.
|
|
228
|
+
2. Pass the site's time zone (`properties.timeZone` from Get Site Properties) in `interval.timezone` so results match the Wix dashboard.
|
|
229
|
+
3. Include a field's `dependencies` in the query, or expect that field to be silently dropped.
|
|
230
|
+
4. Use `formattingEnabled: true` for anything shown directly to a user; keep raw values for calculations.
|
|
231
|
+
5. Use `totalsIncluded: true` to get period totals alongside a paged breakdown in a single call.
|
|
232
|
+
6. Keep `fields` minimal (projection) and paginate large result sets with `offset`.
|
|
233
|
+
|
|
234
|
+
## Related Documentation
|
|
235
|
+
|
|
236
|
+
- [Semantic Model API: Introduction](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/introduction)
|
|
237
|
+
- [Semantic Model API: Sample Flows](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/sample-flows)
|
|
238
|
+
- [List Semantic Models](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/list-semantic-models)
|
|
239
|
+
- [Get Semantic Model](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/get-semantic-model)
|
|
240
|
+
- [Query Semantic Model Data](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/query-semantic-model-data)
|
|
241
|
+
- [Get Site Properties](https://dev.wix.com/docs/api-reference/business-management/site-properties/properties/get-site-properties) (source of the site's `timeZone`)
|
|
@@ -33,7 +33,7 @@ A Bookings service defines a time based offering and includes the following cons
|
|
|
33
33
|
- When creating an APPOINTMENT service and specifying `staffMemberIds`, ensure you are using the staff member's resourceId, not their primary staff member id.
|
|
34
34
|
- Service Images - the service may have several images - `service.media.mainMedia` - presented in the services list, `service.media.coverMedia` - presented in the service page and `service.media.items` - array of images presented as a gallery in the service page for site visitors.
|
|
35
35
|
- In order to add a media (image) to a service, it should first be defined in Wix Media Manager - search existing ([REST](https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/search-files)) or new ([REST](https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/bulk-import-file))
|
|
36
|
-
-
|
|
36
|
+
- Set only the image **id**, but nest it inside the media item's `image` object: `service.media.mainMedia.image.id` (likewise `service.media.coverMedia.image.id` and `service.media.items[].image.id`). The `id` is the binding field; `url` and dimensions are descriptive and need not be set. ⚠️ Setting the id directly on the media item (`service.media.mainMedia.id`, without the `image` wrapper) returns HTTP 200 but **silently drops** it — the image reads back empty (`image.id: ""`). Because it's a silent 200, a success status is not proof: always nest under `.image` and confirm with a re-query.
|
|
37
37
|
|
|
38
38
|
### Service Type Selection Guide
|
|
39
39
|
|