This guide explains the minimum steps required to get a headless project up and running using the Wix CLI. As part of this setup, you'll get a frontend site and private app integrated with a headless project. Every CLI command used in this guide is documented in the Wix CLI Command Reference.
Note: This setup also initializes useful headless settings for your project, such as adding allowed redirect domains and setting a Wix Pages domain.
Note: To develop with AI assistance, install the Wix Plugin for your IDE. It adds Wix Skills and the Wix MCP, giving your AI client the context it needs to help you build CLI projects.
Before getting started, make sure that you:
Run the following command to create a new headless project:
You don't need to do any prior setup in the Wix dashboard. The CLI provisions a business and site for your project automatically. The CLI then prompts you for the details it needs to set up your project.
Note: You can run the command non-interactively, which is especially useful for automated scripts and AI agents. To do so, pass the --project-name, --business-name, and --site-template flags, and separate them from npm's own arguments with --. Passing only some of these flags causes the CLI to error out or fall back to interactive prompts. For the full list of flags, see npm create @wix/new headless.
Enter the name of your business. This is the name of your headless project on Wix. The CLI creates a Wix Headless project for you with this name. This project is added to your Wix sites list.
Choose an initial template for your project. For a list of available templates, see Wix CLI for Headless Templates.
Choose the directory where you want to create your local project files. The CLI generates the local code files for your project in a directory with the name you chose.
Wait for the CLI to generate your project. This includes installing dependencies, initializing a git repository, and configuring your project files.
After the CLI finishes generating your headless project, the CLI builds and publishes your site, and gives you the site URL.
Navigate to your project directory:
Run the dev command to start the local development environment. The CLI builds a local environment for your project and provides links to view your site and dashboard.
The development environment is set up for hot reloading, so any changes you make to your code are immediately reflected in the browser.
Note: In this step we're calling listMembers() in the Wix Members API, but you can use any method in any Wix JavaScript SDK API.
Close the local development environment that started when you ran the dev command.
Install the @wix/members package:
Add the following to your index.astro file's front matter:
Your front matter should look something like this:
Run the dev command to restart the local development environment.
Click the link to open your site.
Return to the terminal. You should see the following log showing that your site currently has 0 members:
Note: If you added members, you may not see their data in this list due to their status being set to PRIVATE by default. For more information, see List Members.
After completing the above steps, you have a simple headless project that you can experiment with and test locally.
You can now: