All skills
wix avatar

/wix-vibe-headless

@1563591 official
by Wix.comwix/skills33 stars
33

Client-only, dependency-free REST scaffolds for connecting an already-built front end (a vibe-coded app, an HTML/JSX/Vite project, a design-tool export) to a live Wix site over the site's public WIX_CLIENT_ID — the browser talks to Wix directly, no SDK, no backend, no build step. One skill covering every Wix business solution: Stores/eCommerce storefront (products, cart, checkout), Bookings (services, slots, appointments), Blog (posts, categories, tags), Events & Tickets (browse, RSVP, ticketing), Portfolio (collections, projects, galleries), Restaurants (menu, online ordering, reservations), Forms (any visitor-fillable form — contact/enquiry, signup, waitlist, application, survey, quote request; schema-driven render + submit), CMS / Wix Data (list, detail, filter, CRUD), Pricing Plans (memberships, subscriptions, checkout), and Members (custom login — email+password, Google/Facebook, and custom SSO — plus account areas and member-gated content). Each vertical ships a copy-as-is REST layer plus wiring instructions. Read-only over the owner's content — never provisions, never mocks data. Triggers: connect my Wix store/shop, build a storefront over Wix, add a cart and checkout, connect Wix Bookings, take appointments/reservations, show my Wix blog, list my Wix events, sell tickets, take RSVPs, build a portfolio from Wix Portfolio, show my restaurant menu / order online / book a table, display my Wix CMS collection, wire a contact form to Wix, add a contact/enquiry form, build a signup or application form, take survey responses, sell membership/subscription plans, add member login / sign up, let members log in with Google or Facebook, custom login page, account / profile page, gate content behind login, sign in with SSO/Okta, 'here is my WIX_CLIENT_ID', connect this app to my Wix site over REST. Use this for CLIENT-ONLY REST integration over an existing site; use `wix-headless` instead for SDK + Wix CLI builds, hosting, and one-prompt new-site creation.

Use this Skill: https://skilld.dev/gh/wix/skills/wix-vibe-headless

This session only. Nothing lands on disk.

referencesrestaurantsseedSEED.md

≈3.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Restaurants — seeding

Seed a Wix Restaurants site by calling seed-restaurants.cjs — don't hand-write the REST calls. It's a build-time module (run via exec_tool, not shipped in the app) that abstracts every seed operation across the vertical's four recipes: the menu (always) plus three on-demand add-ons — online ordering, table reservations, and experiences. require it and call the functions with plain data.

NOT yet live-verified — transcribed from setup-restaurants.md, setup-restaurant-orders.md, setup-restaurant-reservations.md, setup-restaurant-experiences.md.

Default: one call

setupRestaurants(ctx, plan) does the whole seed in one call — installs the Menus app and builds the menu bottom-up (items → sections → menu) with ids kept in memory, so you never hand-thread ids across exec calls. Online ordering and table reservations run only when the plan asks for them.

// build-time exec_tool
const { accessToken } = await base44.asServiceRole.connectors.getConnection("wix");
const seed = require(require("path").resolve(".agents/skills/wix-vibe-headless/references/restaurants/seed/seed-restaurants.cjs"));
const ctx = { token: accessToken, siteId: WIX_METASITE_ID };

const result = await seed.setupRestaurants(ctx, {
  menu: {
    name: "Dinner", description: "Evening menu",
    sections: [
      { name: "Antipasti", description: "To start", items: [
        // imageUrl per item is optional and attached IN this one call. It must be the FINAL
        // https://media.base44.com/... url from the COMPLETED generate_image (it runs in the background
        // while you build — wait for it), never a still-generating /__generating__/<id>.png placeholder.
        { name: "Bruschetta al Pomodoro", description: "Grilled sourdough, San Marzano tomatoes, basil.", price: 9.50, imageUrl: "https://media.base44.com/…" },
      ] },
    ],
  },
  ordering: { address },                            // omit for menu-only; `true` skips the STEP 0 address (flag it)
  reservations: { configuration: { onlineReservations: { partySize: { min: 2, max: 10 } } } },
});
// → { menuId, sectionIds, itemIds, orderingEnabled, reservationsEnabled, imagesAttached }

Seeding is additive — never delete or overwrite existing content. Don't clean up, don't remove "sample" data, don't reset. Just add.

Escape hatch — individual functions

Reach for the functions below only when the one-call setupRestaurants doesn't fit (partial re-seed, custom fulfillment methods, experiences). setupRestaurants is built from them, in this order (items → sections → menu — each child before its parent):

// ── MENU (always; the seedable core) ────────────────────────────────────────────────────────────
await seed.installMenusApp(ctx);                    // if the site doesn't have Wix Restaurants Menus yet

const menu = await seed.createMenu(ctx, {           // builds items → sections → menu bottom-up
  name: "Dinner", description: "Evening menu",
  sections: [
    { name: "Antipasti", description: "To start", items: [
      { name: "Bruschetta al Pomodoro", description: "Grilled sourdough, San Marzano tomatoes, basil.", price: 9.50 },
    ] },
  ],
});                                                 // → { menuId, sectionIds, itemIds }

// optional — import the url to Wix Media (restaurants binds by file id), then attach (full-replace — echo revision + price)
// const file = await seed.importImage(ctx, imageUrl);   // → { id, url } (Wix Media file id + wixstatic url)
// await seed.attachItemImages(ctx, [{ id, revision, price, image: { id: file.id, url: file.url, height: 1024, width: 1024 } }]);

// ── ONLINE ORDERING (add-on, on demand; MENU-FIRST) ──────────────────────────────────────────────
await seed.installOrdersApp(ctx);                   // auto-provisions a working ordering setup
await seed.setBusinessLocation(ctx, address);       // STEP 0 — REQUIRED (see preconditions)
const [op] = await seed.listOperations(ctx);        // verify the auto-created operation (never create one)
// if (op.onlineOrderingStatus !== "ENABLED") await seed.enableOperation(ctx, op.id, op.revision);
const methods = await seed.listFulfillmentMethods(ctx);      // reshape ONLY what the request names
// await seed.updateFulfillmentMethod(ctx, methods[0].id, { revision: methods[0].revision, name: "Delivery", fee: "5" });
const settings = await seed.queryMenuOrderingSettings(ctx);  // confirm each menu is onlineOrderingEnabled

// ── TABLE RESERVATIONS (add-on, on demand; INDEPENDENT of menu/ordering) ─────────────────────────
await seed.installTableReservationsApp(ctx);        // auto-provisions a default reservation location
await seed.setBusinessLocation(ctx, address);       // STEP 0 — shared with ordering (do it once if both)
const [loc] = await seed.listReservationLocations(ctx);      // discover the default (never create one)
// await seed.updateReservationLocation(ctx, loc.id, loc.revision, { onlineReservations: { partySize: { min: 2, max: 10 } } });
await seed.enableOnlineReservations(ctx, loc.id, loc.revision);  // PREMIUM-GATED — 428 on a free site (record, don't fail)

// ── EXPERIENCES (add-on WITHIN Table Reservations, on demand) ────────────────────────────────────
await seed.createExperiences(ctx, loc.id, [{ configuration: { /* per Create-Experience doc */ } }]);

Functions

Menu (setup-restaurants.md)

fn does
installMenusApp(ctx) install the Wix Restaurants Menus app
createMenu(ctx, {name,description?,sections}) items → sections → menu bottom-up → {menuId,sectionIds,itemIds}
importImage(ctx, url) import an external url into Wix Media → {id,url} (file id + wixstatic url); menu items bind by this file id
attachItemImages(ctx, [{id,revision,price,image}]) image pass — full-replace PATCH (echo revision + priceInfo); image.id = a Wix Media file id from importImage

Shared (ordering + reservations STEP 0)

fn does
setBusinessLocation(ctx, location) full-override Update Location (or create if none) — REQUIRED for ordering

Online ordering (setup-restaurant-orders.md) — verify/reshape the auto-provisioned setup

fn does
installOrdersApp(ctx) install the Orders app (auto-provisions operation + methods + per-menu settings)
listOperations(ctx) the auto-created operation(s) — never create one
enableOperation(ctx, id, revision) PATCH onlineOrderingStatus:"ENABLED" (only if not already)
listFulfillmentMethods(ctx) the three auto-created methods
updateFulfillmentMethod(ctx, id, patch) rename / re-fee / disable (partial; fee/minOrderPrice decimal strings)
createFulfillmentMethod(ctx, method) add one beyond the defaults (NOT auto-attached)
setOperationFulfillmentIds(ctx, id, revision, ids) attach a created method (full array)
queryMenuOrderingSettings(ctx) confirm each menu onlineOrderingEnabled + bound to the operation
updateMenuOrderingSettings(ctx, id, patch) flip a menu orderable / display-only

Table reservations (setup-restaurant-reservations.md) — configure the auto-provisioned location

fn does
installTableReservationsApp(ctx) install the app (auto-provisions the default reservation location)
listReservationLocations(ctx) discover the default (never create one — API can't)
updateReservationLocation(ctx, id, revision, configuration) party-size / hours / turnover (config only; location immutable)
enableOnlineReservations(ctx, id, revision) turn online reservations on — PREMIUM-GATED (428 on free)

Experiences (setup-restaurant-experiences.md) — feature of Table Reservations (no extra install)

fn does
createExperiences(ctx, reservationLocationId, experiences) one experience per named dining occasion → [{id,name}]

Ordering rules (do not violate)

  • Menu is bottom-up: items → sections → menu. A section is created with its itemIds, a menu with its sectionIds, so each child must exist before its parent. createMenu does this in three phases.
  • visible: true at every level (item, section, menu) — storefront queries return only visible entities. Baked in by createMenu.
  • Menu before ordering. Seed the menu first, then the ordering add-on (as one unit) — each menu binds to the operation via a menu-ordering-settings object. Ordering auto-provisions per menu either way, but the verify step needs a menu to confirm against.
  • setBusinessLocation STEP 0 is required for ordering — without a real address Wix limits ordering to "testing only" and checkout breaks. Shared with reservations (do it once if both add-ons run).
  • Reservations are independent — they bind to a location, not a menu; no menu-first rule, nothing to bulk-seed (visitors create reservations at runtime).
  • Operations and reservation locations are auto-provisioned — never create them; discover and PATCH.

Preconditions (record in the handoff, do NOT fail the seed)

  • Ordering address (STEP 0) — required; if the brief names none, set a clearly-marked placeholder and flag the owner to set their real business address before ordering works.
  • Paid checkout needs a premium plan + a configured payment method (dashboard/premium — can't be done headlessly).
  • enableOnlineReservations is premium-only — throws 428 PREMIUM_ONLY on a non-premium site; expected and non-fatal, record it and continue (don't retry-spiral).
  • Booking an experience is premium-gated the same way (create works on a free site; booking needs premium + online reservations enabled).

Reference

If a call returns a shape you didn't expect, or you need an operation this module doesn't cover, use the documentation skill available in your environment to search + read the live Wix API reference — never guess. The Experiences create payload especially lives in the docs (fields evolve). The authoritative source recipes are wix-headless/references/inline-recipes/setup-restaurants.md, setup-restaurant-orders.md, setup-restaurant-reservations.md, and setup-restaurant-experiences.md.

Read a method's page before writing its call: it carries the exact body shape, the required permission scope, and the response envelope.

Source: SKILL.md on GitHub

1 warning6d3 checks · Risk SAFE
  • Gen Agent Trust Hub6d

    The skill is safe and provides a comprehensive integration framework for Wix Headless services. It uses platform-secured connectors for authentication and includes automated scaffolding utilities to assist with project setup.

  • Socket6d

    No alerts

  • Snyk6d

    Risk: MEDIUM · 1 issue

Signed by skilld at 1563591. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 4 weeks ago

README badge

README badge for wix/skills/wix-vibe-headless