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.

referencescontext-providerPROVIDER_PATTERN.md

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

Provider Component Pattern

Provider Component Pattern

import React, { createContext, useContext, useState } from 'react';
import type { Text } from '@wix/editor-react-types';

// 1. Define the context type interface (use @wix/editor-react-types types, not plain primitives)
export interface MyContextType {
  someValue: Text;
  someAction: () => void;
}

// 2. Define the provider props interface (matches `data` in registration)
export interface MyProviderProps {
  children?: React.ReactNode;
  initialValue: Text;
}

// 3. Create the context (use null, not undefined)
const MyContext = createContext<MyContextType | null>(null);
MyContext.displayName = 'MyContext';

// 4. Export the hook
export function useMyContext(): MyContextType {
  const context = useContext(MyContext);
  if (!context) {
    throw new Error('useMyContext must be used within a MyProvider');
  }
  return context;
}

// 5. Export the provider component (also as default)
export function MyContextProvider({
  children,
  initialValue,
}: MyProviderProps): React.ReactNode {
  const [someValue, setSomeValue] = useState<Text>(initialValue || '');

  const someAction = () => {
    setSomeValue('updated');
  };

  const api: MyContextType = {
    someValue,
    someAction,
  };

  return (
    <MyContext.Provider value={api}>{children}</MyContext.Provider>
  );
}

MyContextProvider.displayName = 'MyContextProvider';
export default MyContextProvider;

Key Rules for Provider Components

  • Always create a displayName for both the context and the provider component — for human readability
  • Always export the hook as a named export — the manifest's contextSpecifier.hook field references it by name
  • Always export the provider as both a named export and default — the Wix runtime loads the context provider via its default export
  • Always throw an error in the hook if used outside the provider — this surfaces a clear message rather than silently returning null. Keep it throwing when a consumer hits the error; fix the consumer's placement instead (see When the Hook Throws)
  • Always accept children as a prop — the provider wraps whatever the Editor places inside it (page, container, or section content) in the React tree
  • Always use types from @wix/editor-react-types (e.g., NumberType, Text, BooleanValue) instead of plain TypeScript primitives — these types match the actual runtime format Wix provides to components as props, so using plain primitives creates a type mismatch
  • Provider props correspond to the data entries in the extension registration
  • Do not copy a data prop into state the provider never changes — read it straight from props. A data prop is edited in the Editor panel, and useState(prop) keeps only the value it saw on mount, so the panel edit never reaches the page. Copy it into state only when the provider itself writes to that value, and name the prop for what it is (initialValue) so the seed-once behavior is intended rather than a surprise

The Provider's Shape Never Shrinks

Regardless of what the current request asks for:

  • Always export the hook and register contextSpecifier. A request phrased "use native elements, do not create an editor react component" constrains the consumers, never the provider's shape. contextSpecifier.hook is a required manifest field — dropping the hook export or contextSpecifier breaks the manifest for every consumer.
  • Keep the raw values alongside the derived ones. count stays for the text element that displays it; isCongratsBannerHidden is added for the element gated on it. Derived items are additive — they never replace the state they are derived from.

Exposing an item costs nothing: a consumer can ignore any item it does not need.

Async Data and the Render Gate

A provider makes one binary decision for its whole subtree: while its initial data is unresolved, nothing inside it renders — including children bound to nothing at all. Awaiting a promise without handling this ships a blank page on load.

This applies to every promise — every Wix SDK call, every fetch, every await, however fast it usually resolves. A quick call is not an exemption: it still resolves after the first render, so the gate still closes. If producing any context value involves a promise, you MUST read LOADING.md and build the provider the way it describes.

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.