All skills
wix avatar

/wix-app

@dc6f1fa official
by Wix.comwix/skills33 stars
33

Build and review Wix CLI app extensions — dashboard pages, modals, plugins, menu plugins, custom element widgets, Editor React components, site plugins, embedded scripts, backend APIs, backend events, service plugins, data collections, and App Market readiness. Use when building ANY feature or extension for a Wix CLI app or preparing a Wix app for App Market review. Triggers on: add, build, create, implement, help me, dashboard, widget, plugin, backend, API, event, collection, embedded script, service plugin, Editor React component, checkout, shipping, tax, discount, SPI, CMS, schema, tracking, popup, admin panel, menu item, modal, validate, test, verify, register extension, App Market, app review, submission readiness.

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

This session only. Nothing lands on disk.

referencesSERVICE_PLUGIN.md

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

Wix Service Plugin (SPI) Builder

Service plugins are a set of APIs defined by Wix that let you inject custom logic into the existing backend flows of Wix business solutions or introduce entirely new flows. When you implement a service plugin, Wix calls your custom functions during specific flows. Common use cases include eCommerce customization (shipping, fees, payment settings, validations), Bookings customization (staff sorting, booking validation, policies, pricing, availability), Realtime channel permissions, and exposing tools to the Wix AI assistant.

Scaffold

Use wix generate --params with extensionType: SERVICE_PLUGIN. pluginType is one of:

Value SPI Singular
ECOM_ADDITIONAL_FEES Additional Fees No
ECOM_SHIPPING_RATES Shipping Rates Yes
ECOM_DISCOUNTS_TRIGGER Discount Triggers Yes
ECOM_VALIDATIONS Validations No
ECOM_PAYMENT_SETTINGS Payment Settings No
GIFT_CARDS_PROVIDER Gift Cards Provider Yes
STAFF_SORTING_PROVIDER Bookings Staff Sorting No
BOOKINGS_VALIDATION_PROVIDER Bookings Validation No
BOOKING_POLICY_PROVIDER Booking Policy No
BOOKINGS_PRICING_PROVIDER Bookings Pricing Provider No
AVAILABILITY_TIME_SLOTS_CONFIGURATION_PROVIDER Availability Time Slots Configuration No
REALTIME_PERMISSIONS_PROVIDER Realtime Permissions Provider No
TOOLS_PROVIDER_CONFIG Tools Provider No

Singular types — ECOM_SHIPPING_RATES, ECOM_DISCOUNTS_TRIGGER, and GIFT_CARDS_PROVIDER are singular: only one component of each type is allowed per app. Never scaffold or include two components of the same singular type in the same app payload.

name must be lowercase alphanumeric + hyphens, max 19 characters. The CLI generates the folder, plugin.ts, the builder file, the UUID, and the src/extensions.ts registration with the appropriate builder method for the SPI type. Some SPI types (e.g., ECOM_SHIPPING_RATES) get a description placeholder field in the generated builder — replace it with your real copy.

Missing dependency after scaffolding: wix generate adds the SPI's SDK package (e.g. @wix/bookings, @wix/realtime) to package.json, but does not always install it into node_modules. If tsc/wix build reports the import as unresolved right after scaffolding, run npm install <package> for just that package (no need for a full reinstall) before debugging further.

References

You MUST read the relevant reference document before implementing an SPI, and call ReadFullDocsMethodSchema with the docs URL it points at to get the exact request/response types — do NOT edit code until you have the schema. If the schema alone isn't enough, follow up with ReadFullDocsArticle on the same URL for prose explanations and additional code examples. Each reference also contains the correct imports, handler signatures, response structures, and a worked example.

SPI Type Reference
Additional Fees ADDITIONAL-FEES.md
Discount Triggers DISCOUNT-TRIGGERS.md
Gift Cards GIFT-CARDS.md
Payment Settings PAYMENT-SETTINGS.md
Shipping Rates SHIPPING-RATES.md
Validations VALIDATIONS.md
Bookings Staff Sorting BOOKINGS-STAFF-SORTING.md
Bookings Validation BOOKINGS-VALIDATION.md
Booking Policy BOOKING-POLICY.md
Bookings Pricing Provider BOOKINGS-PRICING.md
Availability Time Slots Configuration AVAILABILITY-TIME-SLOTS-CONFIGURATION.md
Realtime Permissions Provider REALTIME-PERMISSIONS.md
Tools Provider TOOLS_PROVIDER.md

Implementation Pattern

The scaffolded plugin.ts imports the relevant module from the SPI's package (@wix/ecom/service-plugins, @wix/bookings/service-plugins, etc.) and calls provideHandlers({...}). Each handler is invoked by Wix on the relevant flow with a { request, metadata } payload and must return the SPI-specific response shape — see the per-SPI reference (Shipping Rates, Validations, etc.) for the exact request/response types and a worked example.

Implementation Requirements

  • Implement ALL required handler functions for the chosen SPI with complete business logic. Focus on the EXACT business logic the user asked for.
  • Validate inputs: required fields present, correctly formatted, business constraints met (minimum order amounts, valid addresses, etc.). Handle missing or malformed data gracefully.
  • Return the exact response shape documented for the SPI; handler responses must match Wix's documented structure.
  • Handle errors gracefully — return appropriate error responses, don't throw unhandled exceptions.
  • Test edge cases (empty carts, missing addresses, invalid data) before reporting completion.
  • If a required capability isn't documented or available in the SDK, surface the gap to the user explicitly — do not fabricate.

Elevating Permissions for API Calls

When making Wix API calls from service plugins, wrap the SDK method with auth.elevate from @wix/essentials before calling it. The pattern is identical for every Wix SDK module (@wix/data, @wix/ecom, @wix/stores, etc.):

import { auth } from "@wix/essentials";
import { items } from "@wix/data";

const elevated = auth.elevate(items.query);
const response = await elevated("myCollection");

Builder field overrides

The CLI generates a builder with id, name, and source. Some SPI types accept additional optional fields you may want to set in the generated builder file:

SPI Type Builder Method Additional Optional Fields
Shipping Rates ecomShippingRates() description, learnMoreUrl, dashboardUrl, fallbackDefinitionMandatory, thumbnailUrl
Validations ecomValidations() validateInCart
Payment Settings ecomPaymentSettings() fallbackValueForRequires3dSecure
Bookings Staff Sorting bookingsStaffSortingProvider() methodName (required), methodDescription (required, max 100 chars), dashboardPluginId

Only ecomShippingRates() accepts description. Passing unsupported fields to other builders causes TypeScript errors. bookingsStaffSortingProvider() requires methodName and methodDescription fields — set these in the generated builder file after scaffolding.

Performance: keep handler logic efficient. Most SPIs run on hot paths (every cart view, every checkout step, etc.).

Testing Service Plugins

To test your service plugin extension:

  1. Release a version with your changes - new service plugins or changes to existing ones won't take effect until you've built and released your project
  2. Trigger the call to your service plugin by performing the relevant action (e.g., add items to cart and view cart to test Additional Fees)

Source: SKILL.md on GitHub

1 warningtoday4 checks · Risk SAFE
  • Gen Agent Trust Hubtoday

    This skill is a specialized development toolkit for building extensions on the Wix platform. It provides comprehensive instructions for creating dashboard pages, backend APIs, and site plugins using the Wix CLI and SDKs. No malicious patterns were detected; the skill's behaviors, such as dependency management, command execution for builds, and local script execution for code reviews, are entirely consistent with its purpose as a developer productivity tool for the Wix ecosystem.

  • Sockettoday

    1 alert: gptAnomaly

  • Snyktoday

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at dc6f1fa. 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
compatibility
requires `@wix/cli` >= 1.1.192.

README badge

README badge for wix/skills/wix-app

Builds dashboard pages, modals, plugins, custom widgets, Editor React components, backend APIs, events, service plugins, and data collections for Wix CLI apps. Provides decision logic, API patterns, and validation workflows; scaffolding is owned by the Wix CLI via `wix generate --params`.

Generated from the current SKILL.md.

What extension types does this skill cover?
All Wix CLI app extension types: dashboard pages, modals, plugins, menu plugins, custom element widgets, Editor React components, site plugins, embedded scripts, backend APIs, backend events, service plugins, and data collections.
Does this skill scaffold the extension files for me?
The Wix CLI owns scaffolding via `wix generate --params` for all extension types except Backend API. This skill provides decision logic, API guidance, and business-logic patterns to fill in the generated stubs. Backend API files must be created manually.
What Wix CLI version is required?
The skill requires @wix/cli >= 1.1.192.
Do I need to create a Data Collection extension for app-specific data?
Yes, if you're saving or persisting app-specific data, managing domain entities in a dashboard, or running a service plugin that reads app-configured data. The skill infers this automatically—you don't need to explicitly request it.
Does this skill cover Wix Stores API usage?
Yes. When using any Wix Stores API (products, inventory, orders), the skill requires dual V1/V3 catalog support and references the Stores Versioning guide for module selection and field mapping.

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