A static site for PICKED, a fresh-produce veg-box shop, powered by Wix Headless eCommerce.
Live site: https://headless-752d6639-yuvalbl47.wix-site-host.com/PICKED.dc.html
picked/— the built static site (index.html,PICKED.dc.html), 3D produce models (.glb), imagery, and the bundled browser cart module (wix-cart.js).wix-integration/— the Wix eCommerce integration source.src/wix-cart.jsis bundled with esbuild intopicked/wix-cart.js, wiring the static site to Wix Stores + Checkout via the@wix/sdk.wix.config.json— template for the Wix CLI project config (initgenerates the realwix.config.json, git-ignored).bootstrap.mjs— helper for verifying the Wix CLI and handling device-code login.
All commands below must be run from inside the
picked/folder, not the monorepo root.
npx serve picked
# or: python3 -m http.server 8000 --directory pickedOpen http://localhost:3000/PICKED.dc.html (or the port serve prints). Until Wix IDs are configured, the site uses its built-in mock cart.
-
Link this folder to a Wix site:
npx @wix/cli login npm create @wix/new@latest init
Set
site.outputDirectoryto"./picked"in the generatedwix.config.json. -
Install Wix Stores on your site and create three veg-box products (small / medium / large) with subscription options for "subscribe & save".
-
Edit
picked/PICKED.dc.html— uncommentwindow.WIX_CART_CONFIGand replace theYOUR_*placeholders with your OAuth Client ID, product IDs, and subscription option IDs. -
Build the cart bundle (after editing
wix-integration/src/wix-cart.js):cd wix-integration npm install npm run build # → ../picked/wix-cart.js
-
Publish:
npx @wix/cli release
Register your deployed domain in the Headless OAuth app's allowed origins so visitor cart calls succeed.
wix-integration/src/wix-cart.js uses a browser-safe OAuth visitor client. The clientId is a public value, safe to ship in the page — it is not a secret API key. Real payment is collected on Wix's hosted checkout page.
Admin utility scripts in wix-integration/ (probe-get.mjs, setstock.mjs, etc.) read TOKEN and SITE_ID from the environment — never commit credentials.
node_modules/and local Wix logs are gitignored.wix.config.jsonis site-specific and must not be committed.
Disclaimer: This is a Wix Headless project created for demonstration purposes only. Cloning or copying this repository is encouraged, but is done entirely at the responsibility of the user. Wix provides no warranties or guarantees regarding fitness for any particular purpose. Always review and test the code before deploying to a production environment.