Service Plugin Extension Files and Code

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.

Copy
FileWhat it's for
<plugin-name>.extension.tsThe configuration file for the plugin ID, name, and handler path.
<plugin-name>.tsThe 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.

Configuration file

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:

Copy
Copy
Copy

A project may include extra fields for that plugin type. The API reference introduction for the plugin lists those fields.

Configuration fields

These fields are on the generated Studio Two configuration. Other fields vary by plugin type.

FieldTypeDescription
idstringService plugin ID as a GUID. It must be unique across extensions in the project. Generate sets it.
namestringThe plugin name. In Studio Two, this is the folder and file name, and it is at most 19 characters.
sourcestringPath to the handler file, relative to the project's src/ directory.

Handler

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:

Copy

In a headless project, export the handlers:

Copy

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.

Registration in Studio Two

A Studio Two project registers the plugin in src/extensions.ts. Generate adds the import and the app().use() call:

Copy

When the project already has other extensions, Generate appends another .use() call to the existing chain.

See also

Last updated: 2 November 2026

Did this help?