Migrate an Event Extension

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

Folder structure

Legacy pathNew path
src/backend/events/<name>/event.tssrc/extensions/backend/events/<name>/<name>.ts
Nonesrc/extensions/backend/events/<name>/<name>.extension.ts

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

Step 1 | Copy and rename the file

In the new project:

  1. Create the folder src/extensions/backend/events/<name>/.
  2. From the legacy project's src/backend/events/<name>/ folder, copy event.ts into the new folder, and rename it to <name>.ts.

Step 2 | Adapt the code to the new project

In <name>.ts:

  1. Add export default before the top-level handler call if it isn't already there:

    Copy
  2. Update any imports as needed, to use the new paths, including imports of backend code.

Step 3 | Create the extension file

In the new project:

  1. In src/extensions/backend/events/<name>/, create <name>.extension.ts.

  2. Add the following code, and set each field to the value the table below specifies:

    Copy
    FieldSource in legacy projectWhat to specify
    idNoneThe ID of the webhook component in your app's released version, or a new UUID if the event has never been released. See Get the event ID.
    sourceNonePath to <name>.ts, relative to src/

Caution: Once your project contains a backend event, changes to your event handlers deploy to production as soon as you release, and take effect without waiting for sites to take a new version. The CLI warns you about this at release time. Test a handler on a development site before releasing it.

This applies to the handler's code. Adding an event your app hasn't released before is a change to your app's webhooks, so it reaches each site according to the app version that site has. See About Webhooks.

Get the event ID

The id depends on whether your app has already released a version containing this event.

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?