Migrate a Service Plugin Extension

Add a service plugin extension to your new Wix CLI project as part of migrating an app from the legacy Wix CLI.

Folder structure

All service plugins follow the same pattern. The <type>/ folder level is removed in the new structure, and the files take the plugin's name:

Legacy pathNew path
src/backend/service-plugins/<type>/<plugin-name>/plugin.tssrc/extensions/backend/service-plugins/<plugin-name>/<plugin-name>.ts
src/backend/service-plugins/<type>/<plugin-name>/plugin.jsonsrc/extensions/backend/service-plugins/<plugin-name>/<plugin-name>.extension.ts

Note: <plugin-name> is your plugin's folder name in the legacy project. The new folder and files use the same name.

Because the folder is named after the plugin rather than its type, an app with more than one plugin of the same type keeps them in separate folders, just as it did before.

Step 1 | Copy and rename the file

In the new project:

  1. Create the folder src/extensions/backend/service-plugins/<plugin-name>/.
  2. From the legacy project's src/backend/service-plugins/<type>/<plugin-name>/ folder, copy plugin.ts into the new folder, and rename it to <plugin-name>.ts.

Don't copy the legacy plugin.json file. You recreate its values in <plugin-name>.extension.ts.

Step 2 | Adapt the code to the new project

In <plugin-name>.ts:

  1. Update any imports as needed, to use the new paths, including imports of backend code.
  2. Add the SDK package the extension's code imports, if it isn't already in your project. The legacy CLI added it for you when it generated the extension: @wix/ecom for the Ecom types, @wix/bookings for the Bookings types, and @wix/realtime for the realtime permissions provider.

Step 3 | Create the extension file

In the new project:

  1. In src/extensions/backend/service-plugins/<plugin-name>/, create <plugin-name>.extension.ts.

  2. Add the following code, and set each field to the value the table below specifies. Replace <builderName> with the builder for your extension's legacy type, which is the extensions function that defines this kind of extension. Builder names and fields lists the builder for each type.

    Copy
    FieldSource in legacy projectWhat to specify
    idid in plugin.jsonCopy source as is
    namename in plugin.jsonCopy source as is
    sourceNonePath to <plugin-name>.ts, relative to src/
  3. If your legacy plugin.json sets additional fields for the extension's type, add them inside the same object. Builder names and fields lists the additional fields each type takes, and Example with optional fields shows where they go. For example, an Ecom validations plugin takes validateInCart, and omitting it stops the plugin from validating the cart.

Important: The id must match the value from the legacy plugin.json. Otherwise, the new entry is treated as a separate extension instead of a continuation of the legacy one.

Builder names and fields

Legacy typeBuilderAdditional fields
ecom-shipping-ratesecomShippingRatesOptional: description, fallbackDefinitionMandatory, learnMoreUrl, dashboardUrl, thumbnailUrl
gift-cards-providerecomGiftCardsNone
ecom-discounts-triggerecomDiscountTriggersNone
ecom-payment-settingsecomPaymentSettingsOptional: fallbackValueForRequires3dSecure
ecom-validationsecomValidationsOptional: validateInCart
ecom-additional-feesecomAdditionalFeesNone
staff-sorting-providerbookingsStaffSortingProviderRequired: methodName, methodDescription. Optional: dashboardPluginId
bookings-pricing-providerbookingsPricingProviderOptional: pricingProviderName
realtime-permissions-providerrealtimePermissionsProviderOptional: providerName

Note: Four legacy service plugin types have no builder in either structure: ecom-recommendations-provider, seo-keywords-suggestions, premium-custom-charges, and external-database-provider. The legacy CLI doesn't generate them, so a project has one only if an earlier version of the legacy CLI generated it. If yours does, check with Wix before migrating it, since the new structure has nothing to migrate it to.

Example with optional fields

Copy

Step 4 | Register the extension

In the new project, in src/extensions.ts:

  1. Import the extension:

    Copy
  2. Add a .use() call for it to the app() chain, on its own line:

    Copy

Step 5 | Return to the main migration guide

Return to Install the extension's dependencies in the main migration guide.

Last updated: 10 November 2026

Did this help?