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.

referencesstripeAUTHENTICATION.md

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

Authentication — stripe (Stripe Projects → Wix)

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.

Inputs from .env

Stripe Projects namespaces each provider's vars, and Wix's own names already begin with WIX_, so a real provision yields a doubled prefix:

Var Role
WIX_WIX_CLIENT_ID the OAuth app client_id — also the frontend OAuthStrategy({ clientId })
WIX_WIX_CLIENT_SECRET the OAuth app client_secret — server-side only; mints the token, never goes to the frontend
WIX_WIX_METASITE_ID the metasite id → the wix-site-id header on every site-scoped call

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.

The public clientId for the frontend's OAuthStrategy is WIX_WIX_CLIENT_ID (not secret).

Minting the token — inline, secret stays out of context

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:

set -a; . ./.env; set +a
curl -sS -X POST "https://www.wixapis.com/oauth2/token" \
  -H "Content-Type: application/json" \
  -d "{\"grant_type\":\"client_credentials\",\"client_id\":\"${WIX_WIX_CLIENT_ID:-$WIX_CLIENT_ID}\",\"client_secret\":\"${WIX_WIX_CLIENT_SECRET:-$WIX_CLIENT_SECRET}\"}" \
  | python3 -c "import sys,json;print(json.load(sys.stdin)['access_token'])" > /tmp/wix_token \
  && test -s /tmp/wix_token && echo "token minted" || echo "MINT FAILED — Wix not connected, or app/creds invalid"

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.

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.

REST call shape

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:

set -a; . ./.env; set +a
TOKEN=$(cat /tmp/wix_token)
SITE_ID="${WIX_WIX_METASITE_ID:-$WIX_METASITE_ID}"
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 (Stores v3, CMS v2, Blog v3, Forms v4, Apps-Installer v1, …). Harmless where unread; 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.

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 2 days ago.

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.