About CLI App Backend Extensions

The Wix CLI allows you to add backend extensions to your app.

The following backend extensions are available in the CLI:

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

All backend extensions built with the CLI have:

  • Logging functionality: You can use the CLI to view logs from the backend of any version of your app. 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 app to inject custom logic into existing app flows or to introduce entirely new flows to Wix sites. You can implement service plugin extensions in your app using the CLI. Read more about service plugin extensions.

API extensions

API extensions allow you to define HTTP functions that can be called from your frontend code. The CLI handles the setup and hosting of the backend code for you, simplifying the development process. These API functions can be invoked from any frontend component in your CLI project. Read more about API extensions.

Event extensions

Events are triggered when specific conditions on your app or a user’s site are met. Wix Apps can respond to these events using event extensions created in the CLI. Events in the CLI are built on Javascript SDK webhooks, and event extensions subscribe your app 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 and Discord, and note them here in the the documentation.

Backend extensions in the CLI have the following limits:

Execution rate limits

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

Request rate limit

  • 1000 requests per second - This is the limit for the total number of backend requests from every instance of your app. 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.

Was this helpful?
Yes
No