Add Event Extensions with the Wix CLI

Events are triggered when specific conditions occur in your project. These are conditions on a Wix user's site. Your project can respond to these events using event extensions. Events in the Wix CLI are built on JavaScript SDK webhooks, and event extensions subscribe your project to these webhooks behind the scenes.

Learn more about event extensions.

Note: Event extensions are built on webhooks. To learn how changes to event extensions reach the sites where your app is installed, see webhooks and versioning.

Follow the instructions below to:

  1. Create an event extension for your project.
  2. Test the event extension in your project.
  3. Deploy your project with the event extension.

Once this task is complete, your project will have an event extension that's triggered when a specific event occurs.

Important:

You can't have 2 event extensions listening to the same event in your app. Each event can only have one handler. This includes extensions added to your app in the app dashboard, not only those in the local files for your project.

Step 1 | Create the extension

In the terminal:

  1. Navigate to your project repo.

  2. Run the generate command.

  3. The CLI will display a menu of extensions to generate. Select Event and hit enter to continue.

  4. The CLI will prompt you to name your event folder. This is the name of the folder in the project directory that contains the event code, and the name of the event. Only you will see this name.

Upon completion, the extension files will be created in your project directory with the following structure:

Copy

Note: This is the default folder structure created by the CLI. You can move these files to any location within the src/ folder and update the references in your extensions.ts file. Learn more about the flexible file system.

Learn more about event extension files and code.

For app projects: You may need to configure permissions for your app to receive the event.

Step 2 | Test your event extension

To check that your event extension runs:

  1. Make sure your project uses the latest version of the CLI. To check and update your CLI version, see Keep the CLI up to date.
  2. Run the build command and then run the preview command.
  3. Open one of the preview links the CLI prints, select a development site, and click Install App. If your app is already installed on that site, clicking Install App updates it to the new preview.
  4. On that site or in its dashboard, take an action that triggers your event.

Build and deploy your project

Once your project is ready for production, you can build and deploy it.

Note: When you release an app project, you release a new version of the app allowing you to publish the app to the Wix App Market or install it on a site with a direct install URL. You can view your app's versions in the app dashboard.

Delete an event extension

To delete an event extension from your project:

  1. Delete the folder that contains your event extension's files.
  2. Remove the import and .use() statements for the extension from the extensions.ts file.

For app projects:

If you already have a version of your app project, you must build and deploy the project again after removing the event extension files.

See also

Last updated: 19 October 2026

Did this help?