When you add a service plugin extension, the generated files land under src/extensions/backend/service-plugins/<plugin-name>/.
A Studio Two site, a Wix CLI app, and a Wix-managed headless project each generate a configuration file and a handler. Studio Two imports the builder from @wix/custom-extensions. A Wix CLI app and a headless project import it from @wix/astro/builders. In a Studio Two project, the extension is also registered in extensions.ts.
| File | What it's for |
|---|---|
<plugin-name>.extension.ts | The configuration file for the plugin ID, name, and handler path. |
<plugin-name>.ts | The handler Wix calls during the host flow. |
<plugin-name> comes from the name you give the plugin. In Studio Two, that name is at most 19 characters.
The <plugin-name>.extension.ts file declares the plugin. The builder function depends on the plugin type. An Ecom Additional Fees plugin uses extensions.ecomAdditionalFees().
Import extensions from the package your project uses:
A project may include extra fields for that plugin type. The API reference introduction for the plugin lists those fields.
These fields are on the generated Studio Two configuration. Other fields vary by plugin type.
| Field | Type | Description |
|---|---|---|
id | string | Service plugin ID as a GUID. It must be unique across extensions in the project. Generate sets it. |
name | string | The plugin name. In Studio Two, this is the folder and file name, and it is at most 19 characters. |
source | string | Path to the handler file, relative to the project's src/ directory. |
The <plugin-name>.ts file is the code Wix calls. Import the plugin from its SDK module and pass your functions to provideHandlers(). The generated file includes one function per method, with an empty return value you replace.
In a Studio Two site or a Wix CLI app, call provideHandlers() directly:
In a headless project, export the handlers:
The import and the function names change with the plugin type. For what the function receives and what it must return, open that plugin in Available Service Plugins and follow the link to its API reference.
A Studio Two project registers the plugin in src/extensions.ts. Generate adds the import and the app().use() call:
When the project already has other extensions, Generate appends another .use() call to the existing chain.
Last updated: 2 November 2026