Start a JSS app in disconnected mode
To develop a JSS application locally without access to a running Sitecore instance, you must start your JSS application in disconnected mode.
Because you do not have access to a Sitecore instance, you must mock content data using local files using the YAML or JSON formats.
If you plan on working with a Next.js JSS application, you must include the
nextjs-styleguide add-on when you create the app. The add-on is responsible for adding the
sitecore/definitions folders required for running the app in disconnected mode.
The following diagram shows the flow of requests from the application to the data files.
Developers can import applications developed in disconnected mode to Sitecore, creating all necessary Sitecore items for the applications to run in connected mode later.
A common development path might be for an application's lifecycle to begin in disconnected mode, and at later development stages transition to connected mode if the limitations of disconnected import need to be circumvented.
JSS applications include a script in their
package.json file to start the application in disconnected mode.
To start the application in disconnected mode:
In a terminal, navigate to your JSS application folder and run the following script:RequestResponseshell
The script starts the local development server.
In your browser, open
http://localhost:3000if it does not open automatically.