Event Extension Files and Code

An event extension has two files:

  • <event-name>.extension.ts: The configuration file. It calls the builder that declares the event extension.
  • <event-name>.ts: The handler. It contains the code that runs when the event fires.

The source field in the configuration file points to the handler.

Configuration file

The configuration file imports extensions and calls extensions.event with the extension's ID and the path to its handler.

Import extensions from the package your project uses:

Copy
Copy
Copy

Builder fields

FieldTypeDescription
idstringThe extension's GUID. The Builder or the CLI generates it.
sourcestringThe path to the handler file, relative to src/.

Handler

The handler is the default export of the file. It calls an SDK event handler function for the event, and passes a function that Wix calls when the event occurs:

Copy

Wix passes the event object to that function. The fields in the object depend on the event. For the payload of each event, see the event's page in the API reference.

The handler runs with no caller identity. To call Wix APIs that need permissions, use elevation. Wix can deliver an event more than once, so write the handler to be idempotent. For delivery behavior, see Events.

See also

Last updated: 2 November 2026

Did this help?