All skills
wix avatar

/wix-headless

@8f7fa5d official
by Wix.comwix/skills33 stars
33

Connect Wix business services (Stores, Bookings, CMS, Blog, Events, Forms, and more) to a Wix Headless frontend — infer the needed capabilities, install the apps, seed backend content, and produce an SDK-integration guide. For managed (Wix-hosted) projects it can also build the frontend: scaffold a new site (create) or wire an existing/brought-in design (connect), then build and release. Works across managed, self-managed, and stripe project types. Triggers: set up a Wix Headless backend, add Wix business features to my app, build or host a Wix site, connect/implement this design with Wix.

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

This session only. Nothing lands on disk.

referencesmanagedAUTHENTICATION.md

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

Authentication — managed (Wix CLI)

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.

1 · Ensure an authenticated CLI session

Secret boundary — mandatory

Never read authentication material or tokens into agent context. Never emit them to stdout, stderr, logs, prompts, or tool results.

npx @wix/cli@latest whoami   # exits 0 when logged in; non-zero when logged out

If it's non-zero, log in yourself — don't punt to the user and stop. A foreground command that exits in seconds, one JSON event per line:

node ../../scripts/bootstrap.mjs   # path relative to this file
Event Do
logged_in Session exists — continue.
awaiting_user (verificationUri, userCode, message) Send message verbatim, then stop. Re-run the script when the user says they're done → logged_in. Re-running early returns the same code, not a new one.
cli_unreachable / login_failed (detail) Show detail and stop.

What the script does

Read ../../scripts/bootstrap.mjs if you want to see it: it sets AI_AGENT so the CLI emits JSON events instead of an interactive TUI, starts wix login detached with its output in a file under the OS temp dir (a pipe would die with the parent), and prints the device code. It is the one login path; there is no manual variant. Codes last ~10 min; after that, run it again and surface the new code.

2 · Mint the token

SITE_ID="<siteId>"   # from wix.config.json
TOKEN=$(npx @wix/cli@latest token --site "$SITE_ID")
  • 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.
  • Use npx @wix/cli@latest token … (not bare wix token) so npx resolves the project-local CLI.
  • The first --site "$SITE_ID" call is the source of truth for SITE_ID; bind it in scratch, don't re-derive mid-run.

3 · clientId for the frontend

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.)

REST call shape

curl -sS -w "\nHTTP_STATUS:%{http_code}" \
  -X POST "https://www.wixapis.com/<endpoint>" \
  -H "Authorization: Bearer $TOKEN" \
  -H "wix-site-id: $SITE_ID" \
  -H "Content-Type: application/json" \
  -d '<body>'
  • Authorization: Bearer $TOKEN — the Bearer prefix is required.
  • wix-site-id: $SITE_ID — required by every site-scoped family; include it always.
  • Content-Type: application/json — on every POST/PATCH body.
  • 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.

Recovery ladder

Re-mint is not a recovery step (the token is byte-identical) — retry the same call with the cached token.

Symptom First response If it still fails
401 Unauthorized Retry once with the cached token. CLI session expired — run npx @wix/cli@latest login (a new session), then re-mint.
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.
404 on a documented URL Re-read the recipe — a path typo. Recipe bug; surface and stop.

Source: SKILL.md on GitHub

1 warning1d3 checks · Risk SAFE
  • Gen Agent Trust Hub1d

    The wix-headless skill is a robust tool for integrating Wix services into headless frontends. It incorporates secure practices for credential management, ensuring tokens remain outside the AI context. While the skill performs remote code execution and has data ingestion surfaces, these actions are carried out through official vendor channels and structured workflows.

  • Socket1d

    1 alert: gptAnomaly

  • Snyk1d

    Risk: LOW · No issues

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

Last checked against GitHub yesterday.

Activeupdated 2 days ago
What it can do
Runs commands Reads files Edits files
All 16 allowed tools
Bash(curl *)Bash(npx @wix/cli@latest *)Bash(npx @wix/cli *)Bash(npm create @wix/new@latest *)Bash(npm install *)Bash(npm run *)Bash(node *)Bash(cd *)Bash(ls *)Bash(mkdir *)Bash(cp *)Bash(mv *)Bash(uuidgen)ReadWriteEdit
  • wix
  • headless
  • ecommerce
  • astro
  • vite
  • jsx
  • hosting
  • cms
  • bookings

README badge

README badge for wix/skills/wix-headless

Scaffolds a new Wix Headless site from scratch or connects an existing HTML/JSX/Vite project to Wix Headless for hosting and business features (ecommerce, bookings, forms, CMS). Handles discovery, design, feature wiring via the Wix SDK, and deployment; routes on operation type (create vs. connect) and frontend framework (Astro by default, or your own build).

Generated from the current SKILL.md.

Does this skill create a new site or connect an existing one?
Both. Path A creates a new site from scratch based on your description (e.g. 'build me an online store'). Path B connects an existing project (HTML/JSX/Vite app, Claude Design output, etc.) to Wix Headless for hosting and feature wiring.
What happens when I connect an existing project to Wix Headless?
The skill analyzes your project, installs the necessary Wix Business Solutions apps, and wires the Wix SDK directly into your existing source files so each installed app powers its corresponding feature.
What frameworks does this skill support?
For new sites, it defaults to Astro but supports any framework you explicitly name (React, Vue, Svelte, Vite, etc.). For existing projects, it works with HTML, JSX, TSX, Vue, and other web frontends.
Does this skill handle ecommerce, bookings, and content sites?
Yes. It routes to different vertical packs depending on your needs: stores and ecommerce, bookings and appointments, CMS and blogs, forms, and gift cards. All verticals include CMS by default.
How does the skill authenticate with Wix?
It uses the Wix CLI (`npx @wix/cli@latest token`) to generate bearer tokens for API calls. The login flow is safe for non-interactive agents and includes a recovery ladder if needed.

Generated from the current SKILL.md. These answers refresh after source changes.