top of page

Creating the first Sitecore headless app

  • Writer: Sridharan Padmanabhan
    Sridharan Padmanabhan
  • Nov 10, 2024
  • 1 min read

Updated: Dec 13, 2024




This would be a friendly walkthrough to creating your first Sitecore headless app.


Prerequisites:

  1. Visual Studio code (or an IDE of your choice)

  2. A running Sitecore instance with JSS services module installed (Refer Installing Sitecore headless rendering for installation of the headless services package to Sitecore)

  3. NodeJS (LTS version)

  4. GIT - Download from here (Only pre-push for linting check during creation of your headless app utilizes local GIT)



Let's create your first headless app


Part 1 - Installing the JSS CLI:


  1. Create a directory for your headless app (mine would be C:\SitecoreJSS\Sitecore headless x React)

  2. Open the directory in VS Code.

  3. Install JSS CLI using

npm install @sitecore-jss/sitecore-jss-cli

The JSS CLI would be the interface for commanding your JSS application.

  1. Verify installation of JSS CLI using

jss --version



Part 2 - Creating the JS app:


  1. Create the JS app using

npx create-sitecore-jss react (for a ReactJS app)

(or)

npx create-sitecore-jss react (for a NextJS app)

(or accordingly for any other framework of your choice)

Specify your application properties (name, path, API type, etc.) for the prompts that follow this command.

  1. A successful creation of the app would show you a message JSS application <your application name> is ready.

    ree
  2. Verify application creation using “jss start”, and launch your application on your http://localhost:3000 (or the right port on your machine)

  3. Now, a headless application is created. Let's proceed to connecting the application to Sitecore in the next steps.




ree

Comments


Sitecore with Sri

Sridharan Padmanabhan

  • Instagram
  • LinkedIn
bottom of page