wix-app
Installation
SKILL.md
Building a Wix app
A Wix app is commonly an embedded dashboard page — a React app the site owner opens in their Wix dashboard, built on the Wix SDK (@wix/sdk, @wix/dashboard). Source lives in integrations/<name>/. Thin frontend over your own backend. Playbook: itsryanarmani/scripts scripts/wix-app/README.md.
The trap that fails the build: import.meta.env is untyped without vite-env.d.ts
A Vite + TypeScript app that reads import.meta.env.VITE_* needs src/vite-env.d.ts containing /// <reference types="vite/client" />. Miss it and tsc fails with TS2339 "Property 'env' does not exist on type 'ImportMeta'". Vite scaffolds this file; a hand-built or worker-built app often omits it. Add the one-line reference.
The other traps
- Wix OAuth authorizes Wix data, not your API. OAuth to Wix identifies the site/instance; your own API still needs its own key, stored per-installation.
- Embedded page = host CSP. Fetch only your allow-listed origin from the dashboard iframe.
- App ID + redirect are Dev-Center-owned — copy the real values from the Wix Dev Center; placeholders break on install.
- tsconfig include — if
vite.config.tsis in both the app tsconfigincludeand a composite node tsconfig, tsc errors TS6305; keepvite.config.tsonly in the node project,include: ["src"]for the app.
Build path
- React dashboard page on
@wix/dashboard;npm run build(tsc --noEmit && vite build). - Compose/schedule a post via your API (
platformTypestring); read Wix context from the SDK.