Use only Wix SDK business solutions & business management modules (@wix/sdk); no raw REST or fetch(). Import modules from npm:@wix/[module] (e.g. npm:@wix/stores, npm:@wix/ecom).
ALWAYS use the fetch_website tool FIRST to confirm exact module names and method signatures. Check the Wix SDK Module Index at the bottom of this file — if the relevant package is listed, fetch that specific module URL directly. If not found in the index, fall back to the full API reference at https://dev.wix.com/docs/api-reference.md. NEVER write Wix code without confirming the API first.
import { createClient } from "npm:@wix/sdk";
import { productsV3 } from "npm:@wix/stores";
const wixClient = createClient({
modules: { productsV3 },
headers: { Authorization: `Bearer ${accessToken}` },
});
const { items } = await wixClient.productsV3.queryProducts().find();- Set token via
headersincreateClient, neverauth. - Pass the entity object directly to create/update (e.g.
updateProduct(id, data)notupdateProduct(id, { product: data })); check the reference for required/updatable fields. - Group functions by business model into fewer backend files to reduce deployment time.
- ALWAYS test the generated Base44 backend functions and fix them if they are not working.
Stores — Catalog V3 only: When using @wix/stores, use only Catalog V3 modules (productsV3, inventoryItemsV3, etc.). NEVER use Catalog V1 (products, inventory, etc.). Inform the user that the app will work only with Catalog V3 stores. Reference: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3.md
Media — convert before rendering: Wix media fields (images, videos) return internal wix:image:// identifiers, NOT renderable URLs. Always use import { media } from 'npm:@wix/sdk' and convert — e.g. const { url } = media.getImageUrl(product.media.mainMedia.image). Never pass raw Wix media identifiers directly to <img src> or similar. Reference: https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/work-with-wix-media.md
| Package | Reference | Top Modules |
|---|---|---|
@wix/stores |
Catalog V3 | Products V3 · Inventory V3 · Categories |
@wix/ecom |
eCommerce | Orders · Checkout · Cart |
@wix/bookings |
Bookings | Services · Bookings · Staff Members |
@wix/events |
Events | Events V3 · Ticket Definitions V3 · RSVP V2 |
@wix/restaurants |
Restaurants | Menus · Online Orders · Reservations |
@wix/blog |
Blog | Posts & Stats · Draft Posts · Categories |
@wix/crm |
Contacts | Contacts |
@wix/members |
Members | Members |
@wix/inbox |
Inbox | Messages · Conversations |
@wix/forms |
Forms | Form Schemas · Form Submissions |