---
title: "JSS initializer parameters"
slug: "jss-initializer-parameters"
abstract: ""
---
# JSS initializer parameters

This topic lists all valid parameters you can include when using `npx` to [initialize a local JSS application](https://doc.sitecore.com/sai/en/developers/jss/22/jss-sai/create-a-jss-app-locally.html "Create a JSS app locally"). Using them will reduce the number of questions you're asked while running the JSS initializer.

> [!note]
> These parameters are not available when using other package managers such as `npm` or `yarn` to initialize a JSS app.

## The base app template and add-ons

Every JSS app is based on a starter template, which determines the framework that powers the app. The `templates` parameter accepts a comma-separated string list containing the name of the base app template and the names of any add-ons you want the app to include.

The `templates` list must include one of the following base app templates names:

- `nextjs`
- `angular`

Depending on the chosen base app, you also need to include one of the following SitecoreAI add-ons:

- `node-xmcloud-proxy` - required for non-Next.js (such as Angular) apps to connect to SitecoreAI.
- `nextjs-xmcloud` - required for Next.js apps to connect to SitecoreAI.

> [!note]
> If you only specify a base app template, the initializer will ask you whether you're building for SitecoreAI and, if so, it will install the required add-on automatically.

> [!note]
> **XM Cloud is now SitecoreAI**
> Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.

Lastly, you can specify add-ons relevant to the chosen base template, such as:

- `nextjs-sxa` - an important add-on for Next.js JSS apps for SitecoreAI. It includes configurations for Next.js headless projects and Sitecore Experience Accelerator (SXA) example components. Always include this add-on when working with the Next.js starter template.
- `nextjs-multisite` - an optional add-on that includes an example setup for hosting multiple sites from a single Next.js application.

> [!note]
> The `nextjs-styleguide` add-on is not relevant for SitecoreAI apps, and it is not compatible with `nextjs-sxa`, so you can ignore it.

The following example command initializes a Next.js app with the SitecoreAI and SXA add-ons.

```shell
npx create-sitecore-jss --templates nextjs,nextjs-xmcloud,nextjs-sxa

```

When placing the `templates` parameter first like this, you can omit `--templates` and write the list as is, such as:

```shell
npx create-sitecore-jss nextjs,nextjs-xmcloud,nextjs-sxa

```

> [!note]
> **XM Cloud is now SitecoreAI**
> Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.

## Main parameters

All of these parameters are optional, but using them lets you quickly create apps based on common settings without having to answer all the standard questions during the initialization process.

> [!note]
> All of these parameters accept string values.

| Parameter | Description |
| --- | --- |
| `appName` | The name of your JSS application.<br><br>Default: `sitecore-jss-app` |
| `destination` | Path or directory for the new application.<br><br>If you provide a path that already contains files, the initializer will warn you and confirm that you want to proceed. For the files potentially changed by the initializer, you'll have the option to approve changes for each file, skip individual files, approve changes to all files, or abort the process.<br><br>Using the initializer in a non-empty destination helps you apply add-on templates to an existing JSS app.<br><br>Default: `<current-directory-path>/<base-template-name>` |
| `fetchWith` | Method for fetching data. You can choose `REST` or `GraphQL`, but for SitecoreAI we strongly recommend using GraphQL in all JSS apps.<br><br>Default: `GraphQL` |
| `prerender` | Only available if using the `nextjs` template. Prerendering method for the application. Choose between static site generation (SSG) and server-side rendering (SSR).<br><br>Default: `SSG` |
| `language` | Only valid if using the `nextjs-styleguide` add-on. Language and locale code. For example, `es-MX`.<br><br>Default: `da-DK` |
| `hostName` | The hostname of your Sitecore instance.<br><br>Default: `<appName>.dev.local` |

For example, if you use the following command, you won't be prompted to choose templates, an app name, or a fetch method while initializing your app:

```shell
npx create-sitecore-jss nextjs,nextjs-xmcloud,nextjs-multisite --appName my-nextjs-app --fetchWith GraphQL

```

> [!note]
> **XM Cloud is now SitecoreAI**
> Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.

## Optional parameters

These optional parameters can be added to your `npx` command to modify the JSS app initialization process, based on your preferences.

> [!note]
> These parameters do not take a value. Including one of them will apply an effect as described in the following table.

| Parameter | Effect when included |
| --- | --- |
| `appPrefix` | Instructs the application to do the following:<br><br><ul><li>Prefixes all templates with your app's `appName` argument. Ordinarily, deploying multiple templates with the same name will cause conflict errors when using strongly typed GraphQL queries.</li><li>Prefixes all placeholders with your app's `appName` argument. If you have multiple JSS apps deployed to SitecoreAI, enabling this option ensures that when you add components to placeholders in SitecoreAI, you can only choose components for the current site.</li></ul> |
| `force` | Skips all initializer questions related to file system operations, choosing the default option for each. |
| `silent` | Hides all log messages while the initializer is running. |
| `prePushHook` | Each time you push changes to your remote repo, runs a linting script that validates all TypeScript types and code formatting. |
| `yes` | Skips all initializer questions related to CLI argument values, choosing the default option for each. |
| `--xmcloud` | The initializer uses the `nextjs-xmcloud` template to scaffold the JSS application. |

> [!note]
> **XM Cloud is now SitecoreAI**
> Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.