About Wix CLI for Headless Backend Extensions

This feature is in Developer Preview and is subject to change.

The Wix CLI for Headless allows you to add backend extensions to your project.

The following backend extensions are available in the CLI for Headless:

You can add these extensions using the npm run generate command.

All backend extensions built with the CLI for Headless have:

  • Logging functionality: You can use the CLI to view logs from the backend of any version of your project. Read more about logging.
  • Limits: Backend extensions have execution limits, rate limits, and a time limit for backend functionality in previews. Read more about limits.

Service plugin extensions

Service plugin extensions (formerly SPIs) are a set of APIs defined by Wix that you can use to enable your project to inject custom logic into existing flows or to introduce entirely new flows to Wix sites. You can implement service plugin extensions in your project using the CLI for Headless. Read more about service plugin extensions.

Event extensions

Events are triggered when specific conditions on your project are met. Your project can respond to these events using event extensions created in the CLI for Headless. Events in the CLI for Headless are built on Javascript SDK webhooks, and event extensions subscribe your project to these webhooks behind the scenes. Read more about event extensions.

Logging

You can use the CLI to view logs from the backend of any version of your app.

For instructions on how to do this, see logs in the CLI Command Reference.

Limits

Important: Limits are subject to change. We will notify you of any upcoming changes through the CLI for Headless and Discord, and note them here in the documentation.

Backend extensions in the CLI for Headless have the following limits:

Execution rate limits

  • 1000 CPU MS per request - Backend requests taking longer than 1000 CPU MS to complete are terminated.
  • 20 sub-requests - Sub-requests are requests made from your backend extensions, such as calls to Wix APIs, in response to a request. Your project can make up to 20 sub-requests in response to each request. Sub-requests beyond the 20th will not be made.

Request rate limit

  • 1000 requests per second - This is the limit for the total number of backend requests from your project. Requests beyond this are ignored.

Backend functionality for previews

Previews generated by npm run preview last indefinitely. However, any backend extensions in these previews stop functioning after 3 days.

Did this help?