About the Wix CLI for Headless

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

The Wix CLI for Headless is a tool for creating and deploying Wix Headless projects through commands in the terminal. The CLI simplifies Headless project development by automatically generating a complete project structure, featuring a frontend integrated with Wix's backend services. The CLI takes care of the initial setup and configuration, so you can focus on building the unique features of your site. The CLI provides:

  • Integration with Astro.
  • A serverless hosting solution for your project's frontend.
  • A Wix-hosted private app that handles authentication and enables you to add extensions to your project's backend and dashboard.
  • Local preview of your project with hot reloading.

Note: We're actively working on improving the Wix CLI for Headless, adding features, and providing comprehensive documentation. Help us improve the CLI by providing feedback and suggestions. You can join our community of Wix App developers on Discord.

Integration with Astro

Wix CLI for Headless projects are pre-configured to integrate Astro with Wix. This lets you concentrate on building your frontend while the integration takes care of connecting to Wix's platform behind the scenes.

The main features of the Wix integration for Astro include:

  • Easy SDK integration: Use the Wix Javascript SDK modules directly through a pre-initialized and contextually available Wix Client.
  • Session management middleware: A middleware manages session tokens and cookies for the current site visitor, allowing you to use stateful session APIs like e-commerce carts, user authentication, and more.
  • Adapter for Wix Hosting: The integration provides an adapter for Wix hosting, allowing you to deploy your Astro project to Wix hosting.

The CLI generates the code for an Astro site when you create your project, so you can begin developing immediately. You can choose from a range of templates for your starting Astro site.

Serverless hosting

Scaling, resource allocation, and maintenance are fully managed for you, so you don't have to worry about infrastructure.

The main features of serverless hosting include:

  • Static sites hosting: The hosting environment is powered by a global CDN that ensures fast and reliable content delivery to your users.
  • Serverless architecture: Run full-stack applications without managing servers. Scaling and resource management are handled automatically by Wix.
  • Automatic SSL certificates: SSL certificates are automatically provisioned and renewed for your custom frontend, ensuring secure connections.
  • Custom domain support: You can use a custom domain for your custom frontend to provide a branded experience for your users.

Wix private app and extensions

The CLI automatically creates a private Wix app when you create your project. This private app serves two main purposes:

  • OAuth authentication: The app acts as the OAuth app that handles authentication for your project's frontend.
  • Extension support: You can add extensions to the app that enhance your project's dashboard and backend functionality.

Local preview

The CLI provides a local development environment for previewing Headless projects and app extensions in real-time.

The environment is set up for hot reloading, so any changes you make to your code are immediately reflected in the browser.

You can also create shareable project previews for collaboration.

Get started

  • To get up and running as quickly as possible, see our Quick Start article.
Did this help?