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.
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:
| Field | Type | Description |
|---|---|---|
id | string | The extension's GUID. The Builder or the CLI generates it. |
source | string | The path to the handler file, relative to src/. |
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:
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.
Last updated: 2 November 2026