Index of every page on this site: llms.txt
All skills
wix avatar

/wix-app

@e2bc48e official
by Wix.comwix/skills40 stars
42
Run it yourself

Build and review Wix CLI app extensions — dashboard pages, modals, plugins, menu plugins, custom element widgets, Editor React components, site plugins, embedded scripts, context providers, function libraries, lightbox (popup) behavior, page onLoad contexts, 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, context provider, function library, onLoad, on page load, checkout, shipping, tax, discount, SPI, CMS, schema, tracking, popup, lightbox, 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

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesFUNCTION_LIBRARY.md

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

Function Library

Studio 2 editor only. This extension type works only on sites built in the Studio 2 editor. It does not run on Harmony, the classic Wix Editor or Wix Studio (Editor X), so do not offer it for those sites. Apps can't use it: if wix.config.json has "projectType": "App", tell the user before building.

A function library bundles reusable functions the Wix editor and runtime can call — formatters, math helpers, data transformers, event handlers. It is a registered extensions.functionLibrary() extension, not a plain utility module: functions in utils.ts, helpers.ts or src/lib/ are invisible to the editor.

You MUST read FUNCTION_LIBRARY_SPEC.md before implementing a function library. It holds the manifest fields, DOM event types and type constraints; the data types are in DATA_TYPES.md.

Quick Start Checklist

  1. Scaffold with the Wix CLI, from the project root:

    npx wix generate --params '{"extensionType":"FUNCTION_LIBRARY","name":"<library-name>"}'

    name is kebab-case (e.g. car-formatting) — the CLI rejects spaces and uppercase. It derives the folder, type, id and the src/extensions.ts registration from it, and creates src/extensions/site/function-libraries/{library-name}/{library-name}.ts (a formatPrice stub) and {library-name}.extension.ts.

  2. In {library-name}.extension.ts, add resources.moduleSpecifier (the scaffold omits it, see Hard Constraints) and set name to a Title Case display name (e.g. Car Formatting, max 100 chars) — the scaffold writes the kebab-case name there, and the editor lists the library under it

  3. Install @wix/editor-react-types as a devDependency if not already present

  4. Replace the formatPrice stub in {library-name}.ts with your named exports, and the formatPrice entry in the functions map with one entry per function (parameters, return type, async flag). Keep the CLI-generated id

moduleSpecifier sits directly under resources, next to client, not inside it. tsc does not catch a misplaced one:

resources: {
  client: { /* generated, leave as is */ },
  moduleSpecifier: '@/car-formatting',
},

extensions comes from @wix/astro/builders/experimental (current scaffold) or @wix/custom-extensions (older scaffolds). Both work: keep the import the scaffold wrote. If tsc reports that functionLibrary does not exist on extensions, upgrade that package.

Hard Constraints

  • Always set resources.moduleSpecifier to <moduleSpecifierPrefix><library-name> (e.g. @/car-formatting). <moduleSpecifierPrefix> is @/ by default, or the prefix the user gives you. Module specifiers are unique across all of Wix, not per app: an unprefixed name may already belong to another app, and the checkpoint then fails with Error during component specifier upsert
  • Never change the moduleSpecifier of a library that already exists — a registered module specifier cannot be renamed. The prefix rule applies to new libraries only
  • Exported function names MUST exactly match the keys in the functions map — a mismatch means the editor references a function that doesn't exist at runtime. Named exports only, no export default
  • The boolean type is booleanValue — NOT boolean, which is a TypeScript primitive and not a valid dataType
  • Match each declared data type to its runtime value. richText requires a RichText object from @wix/editor-react-types with text, html, and linkList; an HTML string is not one. For plain strings, declare text. See RichText values
  • Do NOT use disallowed data types (listed in the spec), at most 10 parameters per function, each parameter has exactly one of dataType or domEvent, and optional parameters come last
  • Do NOT invent or assume new types, modules, or imports
  • NEVER use mocks, placeholders, or TODOs — implement complete, production-ready functionality

Library Implementation Pattern

import type { Text, NumberType, WebUrl } from '@wix/editor-react-types';

export function capitalize(text: Text): Text {
  return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase();
}

export function sum(numbers: NumberType[]): NumberType {
  return numbers.reduce((acc, num) => acc + num, 0);
}

export async function fetchData(url: WebUrl): Promise<Text> {
  const response = await fetch(url);
  return await response.text();
}

export function logEvent(eventName: Text): void {
  console.log(`[event] ${eventName}`);
}

Key Rules for Library Files

  • Use types from @wix/editor-react-types — Text, NumberType, BooleanValue, WebUrl, etc. — these match the runtime format Wix provides. Other types are exported under their PascalCase name too (LocalDate, TextEnum, RichText); grep the package rather than guessing. A textEnum parameter is typed TextEnum (a string)
  • DOM event parameters (domEvent) take the matching DOM type: POINTER → PointerEvent, KEYBOARD → KeyboardEvent, FOCUS → FocusEvent, CHANGE → Event, SUBMIT → SubmitEvent
  • Functions can be async — mark with async and return a Promise<T> when the registration sets async: true. returns describes the resolved value's type, not the Promise
  • Void functions — functions with no return value should return void; omit returns in the registration
  • No side-effect imports at module scope — keep the file SSR-safe

Function Definitions

Each key of the functions map is a function name and each value a Function object — see FUNCTION_LIBRARY_SPEC.md for its fields and PARAMETER_PATTERNS.md for parameter examples (optional, complex objects, arrays, textEnum, async, void, DOM events).

Reference Documentation

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

2 warningstoday4 checks · Risk SAFE
  • Gen Agent Trust Hubtoday

    This skill provides a comprehensive environment and set of tools for building Wix CLI app extensions. It includes detailed instructions, API references, and local utility scripts for development tasks like SDK lookup and accessibility auditing. All operations and dependencies are standard for the Wix developer platform.

  • Sockettoday

    1 alert: gptAnomaly

  • Snyktoday

    Risk: MEDIUM · 1 issue

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at e2bc48e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 6 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.