The Wix CLI allows you to easily extend your headless project's functionality with extensions. For example, with extensions you can add custom dashboard pages or implement backend logic to handle events.
The Wix CLI supports multiple extension types. The creation and setup process for extensions in the CLI takes place in the terminal. Then, to edit your extensions, you write code directly in your project's local files.
Note: When you add an extension to a headless project, the CLI adds it to your project's private Wix app.
You can add extensions to your project using the generate command.
This command starts a process that guides you through adding an extension to your project.
After selecting an extension, you'll be prompted for the relevant configuration details. Your extension will then be generated in your project's local files under src/extensions/. If you want to move your extension files in your project, make sure the new path is specified in the extension.ts file. Learn more about the extension.ts file.
Important:
Some extensions require you to run release to register them in your project's app configuration before they work. The preview command uploads your code but doesn't register all extensions.
The Wix CLI currently supports the following extensions for headless projects:
Note: The CLI also supports site extensions, but those apply only to Wix app projects, not headless projects. In a headless project you control your own frontend, so there's no need to extend it with site extensions.
Wix CLI projects support HTTP endpoints for backend API development.